Python 4 Flashcards

1
Q

How to define a function? and make a function to make a sandwich

A

-Use def
def functionname ( paramlist ):
def add_numbers(a, b)
sum = a + b
return sum
result = add_numbers(5, 3)
print(‘This sum is: “,result)

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

Global variables

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

Defaul\

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