Reusing code with functions Flashcards

1
Q

How do we start grouping related code?

A

By adding 🔸def🔸 keyword

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do we name a function?

A

By using snake case

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the 🔸:🔸 do?

A

Mark the beginning of a function’s code block

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Where does the code we want to group together go?

A

After the function definition, indented by two spaces

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do we run the code inside a function?

A

By calling it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly