NEW
Font size
S
M
L
XL
WorksheetsLesson 3 Recap
Total questions: 6
Worksheet time: 5mins
Name
Class
Date
1.
What keyword is used to define a function in Python?
a)
def
b)
define
c)
function
d)
class
2.
Which of the following is not a valid Python variable name?
a)
my_var
b)
myVar
c)
my-var
d)
myvar
3.
What is the result of the following code: 5 < 3 or 2 > 1?
a)
True
b)
False
c)
SyntaxError
d)
TypeError
4.
What is the result of the following code: for i in range(5): print(i)?
a)
1, 2, 3, 4, 5
b)
TypeError
c)
0, 1, 2, 3, 4
d)
0, 1, 2, 3, 4, 5
5.
What is the result of the following code:
x = 5
y = 3
print(x % y)
?
a)
1
b)
1.67
c)
2
d)
TypeError
6.
What keyword is used to return data from a function in python?
a)
return
b)
pass
c)
data
d)
def
Reset
