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 add(a, b): return a + b add(3) | AError: Too many arguments | |
| 2def greet(name): print('Hi ' + name) greet('Al', 'Bob') | BError: Missing argument for b | |
| 3def greet(name): print('Hi ' + name) greet('Alice') | COutput: 8 | |
| 4def add(a, b): return a + b | DValid: One parameter, one arg | |
| 5def square(n): return n * n print(square(4)) | EOutput: 16 | |
| 6def add(a, b): return a + b print(add(3, 5)) | FOk: Two parameters |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Parameter — A variable name in the function definition that receives data.~~Argumentdef greet(name):
print('Hi ' + name)
greet('Alice')def add(a, b):
print(a + b)
add(3, 5)def greet(name):
print('Hi ' + name)
greet(Alice)def double(number):
print(number * 2)
double(5)def show(x, y):
print(x + y)
show(5, 10)