WorksheetsPython conditionals, and loops |Part 3
Total questions: 36
Worksheet time: 54mins
What part of an if statement should be indented?
All of it
The statements within it
the first line
the lines within the brackets
What is the output?
more than 7
more than 23
spam
7
What is the output?
True
False
condition1
condition2
What is the output?
250.0
200.0
300.0
350.0
What is the output?
next
stop
next
stop
syntax error - program doesn't work
What is the output?
3
3
7
3
5
7
7
What is the output?
condition
True
Program has a syntax error.
3 > 2
What is the output?
True
NIL
True
NIL
True
NIL
NIL
What is the output?
level 3
level 3
level 1
level 3
level 1
NIL
level 3
level 2
level 1
NIL
What is the output?
40
15.0
30
25.0
What will be the output
four
4
one , two
three
What will be the output?
x is greater than 5
x is equal to 10
x is greater than 5
x is greater than 10
x is equal to 10
What will be the output?
nested: x == 10
nested: else
nested: x == 6
else
The % symbol in Python is used to.
Get the reminder of a division problem.
Divide the number
Calculate the percentage
Print the output
What will be the output?
a and b is 7
a or b is 4
not a is True
a and b is 4
a or b is 7
not a is False
Syntax error
a and b is False
a or b is True
not a is True
Which two statements are used to implement iteration/Repetition)?
4
3
2
1
3
2
1
0
4
3
2
1
3
2
1
0
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
......(repeated continuously)
False
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
(repeated continuously)
Which of these codes is correct for creating a list of numbers?
num = ('10','29','37','109')
num = ['10','29','37','109']
num == ('10','29','37','109')
num = ['10 29 37 109']
What does the '#' allow you to do?
Repeat code
Comment on code
Print code
End code
What will this code do?
Print Numbers 1-11
Print Numbers 1-10
Print Numbers 2-10
Print Error
What does the following program display?
1,2,3,4
counter,counter,counter,counter,counter
1,2,3,4,5
0,1,2,3,4,5
if you wished a loop to repeat 3 types what should you use?
For counter in range(0,5):
For counter in range(0.3):
For counter in range(1.3):
what is the name of the variable used in the following code?
counter
for
#example
What type of loop is used when you know how many times you want to repeat something?
A WHILE Loop
An IF function
A FOR Loop
A Variable
What will this code do?
Print Numbers 1-11
Print Numbers 2-10
Print Numbers 1-10
Print Error
