Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1def greet() print('Hi') | AValid: Function defined | |
| 2Def say_hi(): print('Hi') | BOk: Define then call | |
| 3def greet(): print('Hello') | CError: Missing colon after def | |
| 4def greet(): print('Hi') greet() | DOutput: (nothing) | |
| 5def say_hi(): print('Hi!') say_hi() | EOutput: Hi! | |
| 6def say_hi(): print('Hi!') | FError: 'def' is lowercase |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
def — Keyword that creates (defines) a new function.~~Functiondef greet():
print('Hello!')def greet():
print('Hello!')def greet():
print('Hello!')
greet()def say_hi():
print('Hi!')
say_hi()def welcome():
print('Welcome!')
welcome()