Worksheetspython
Total questions: 50
Worksheet time: 23mins
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
What is a Count-Controlled loop?
for loop
while loop
A count controlled loop will..
Repeat code until a condition is met
Repeat code a specific amount of times
Repeat code a random amount of times
None of the above
What will this code do?
Print Numbers 1-11
Print Numbers 1-10
Print Numbers 2-10
Print Error
What sort of loop is this?
Count Controlled
Condition Controlled
What will this code print?
Print the word 'letter'.
Print a user input on one line.
Print a user input one letter at a time.
Print an Error.
Which of these is NOT a loop in python?
for loop
while loop
nested loop
if loop
Which of these operators means EQUAL TO?
'='
'=>'
'<='
'=='
What will be the output of this code?
1,2,3,4,5,6,7,8,9,10,11,12
0,2,4,6,8,10
2,4,6,8,10,12
2,4,6,8,10
What does the '#' allow you to do?
Repeat code
Comment on code
Print code
End code
Which of these will allow me to count from 0-20 in steps of 5?
for x in range(0,20):
print(x)
while x = (0,20,5):
print(x)
for x in range(0,21,5):
print(x)
for x in range(0,21,5):
print(y)
If i want to continuously check for a correct answer, what loop would i use?
for loop
while loop
What is the error in this code?
incorrect variable name
incorrect indentation
incorrect speech marks
incorrect loop
A condition controlled loop is...
A while loop
A for loop
Which python operator means 'less than or equal to'?
>=
>
<
<=
What is the value of the expression 100 / 25?
4
4.0
"4.0"
'4.0'
What is the output of the following code :
print 9//2
4.5
4.0
4
3
Which is the correct operator for power(x^y)?
X^y
X**y
X^^y
None of the mentioned
Which one of these is floor division?
/
//
%
None of the mentioned
What is the answer of this expression, 22 % 3 is?
7
1
0
5
x = 4.5
y = 2
print(x//y)
2.0
2
9
9.0
x = 5
print(x > 3 and x < 10)
True
False
x = 10
print(x > 3 and x < 9)
True
False
x = 8
print(x > 3 or x < 20)
True
False
x = 14
print(x > 10 or x < 3)
True
False
x = 5
print(x < 2 or x < 3)
True
False
x = 5
print(not(x > 3 and x < 10))
True
False
x = 5
print(not(x > 3 or x < 2))
True
False
x = 5
print(not(x > 6 or x < 3 ))
True
False
x = 5
y = 3
print(x == y)
True
False
x = "5"
y = 5
print(x == y)
True
False
x = 5
y = 3
print(x != y)
True
False
x = 10
y = 10
print(x != y)
True
False
