Intro To Functions Flashcards

1
Q

Recall code: assigning a function and creating one

A

def name_of_function():
Code here etc

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

Recall code: calling a function

A

name_of_function()

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

What does the following code do?
def name_of_function():
Code here etc

A

It creates a function and the “:” is assigning that function to the code below

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

What does the following code do?
name_of_function()

A

It initiates the function by calling it’s name

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

Recall code: assigning a parameter to a function

A

def my_function(parameter):

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

What does the following code do?
def my_function(parameter)

A

It creates a function along with a parameter (a placeholder for said condition)

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

Recall code: Calling a function and assigning a condition towards parameter

A

my_function(custom_name_here)

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