Font size
WorksheetsPython Functions and Returns
Total questions: 14
Worksheet time: 12mins
What does the following code output?
11, 9
16, 16
None, None
225, 117
Which of the following is the correct code to define a function?
def area ( ):
area ( )
def area:
def area ( )
Which keyword marks a spot in a function where the program flow will go back to the calling code?
break
return
continue
jump
Which of the following statements correctly defines a function named "haunted" that takes a parameter named "apple"?
haunted(apple)
haunted
def haunted(apple):
apple
Which of the following statements will successfully send the value "EEK" back from a function to the calling code?
EEK
return EEK
back EEK
#print(EEK)
What should go under the line that says if right > .7?
(a)
What should go in the else statement?
(a)
What should go in the blank of the while statement?
is_over_line()
is_over_line
is_over_line(reflectance.get_right)
reflectance.get_right()
Create a function named your_mom with a parameter age
(a)
When you use your function, you will want to take the age and subtract 21. Write what would be inside the function
(a)
Call the function your_mom with the argument 56
(a)
what will happen in the console when you run this code:
print(your_mom(56))
(a)
