Font size
WorksheetsPython Loops
Total questions: 27
Worksheet time: 15mins
Look at the following code, what will it generate
1,2,3,4,5,6,7,8,9,10,11,12
0,1,2,3,4,5,6,7,8,9,10,11,12
1,2,3,4,5,6,7,8,9,10,11,12,13
0,1,2,3,4,5,6,7,8,9,10,11,12,13
What does the following program display?
1,2,3,4
1,2,3,4,5
counter,counter,counter,counter,counter
0,1,2,3,4,5
1,2,3,4
When do you know when you come to the end of the loop?
Its states End loop
The command End is given
The indentation stops
if you wished a loop to repeat 3 types whwt should you use?
For counter in range(0,5):
For counter in range(1.3):
For counter in range(0.3):
what is the name of the variable used in the following code?
counter
for
#
In programming, what is iteration?
The repetition of steps within a program
The order in which instructions are carried out
A decision point in a program
Testing a program to make sure it works
A condition is
a statement that is either True or False
a string
an integer
a list
4
3
2
1
3
2
1
0
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)
break
