NEW
Font size
Worksheetsfor---Loop
Total questions: 13
Worksheet time: 7mins
FOR loops are
loops which run an unknown number of times
loops which run for a specific number of times
the same as if statements
not part of programming
Which of these operators means EQUAL TO?
'='
'=>'
'<='
'=='
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)
what will this display?/ Экранға қандай жауап шығады?
0,1,2,3,4,5
0,1,2,3,4
1,2,3,4,5
Error
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
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
what is the name of the variable used in the following code?
counter
for
#
The program above
prints all the odd numbers between 1 and 20
prints all even numbers between 1 and 20
print all the odd numbers between 1 and 21
prints all the even numbers between 1 and 21
