wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

For Loop

Total questions: 22

Worksheet time: 15mins

Name
Class
Date
1.

This loop can only be used when the programmer knows the number of times a code is to be repeated

a)

while

b)

for

c)

do while

d)

repeat until

2.

Which of the following control structure are needed to repeat a code?

a)

sequence

b)

loop

c)

selection

d)

if

3.

FOR loops are

a)

loops which run an unknown number of times

b)

loops which run for a specific number of times

c)

the same as if statements

d)

not part of programming

4.

Which kind of loop would be used?


I need a program that will keep letting me add a monthly payment for 12 months.

a)

FOR Loop

b)

WHILE Loop

5.

Which kind of loop would be used?


I need a revision program that will run through revision questions 4 times.

a)

FOR Loop

b)

WHILE Loop

6.

Which kind of loop would be used?


I need a guessing game program that will let me keep guessing until I get the right answer.

a)

FOR Loop

b)

WHILE Loop

7.

FOR loops are

a)

loops which run an unknown number of times

b)

loops which run for a specific number of times

c)

the same as if statements

d)

not part of programming

8.

WHILE loops are

a)

loops which run an unknown number of times

b)

loops which run for a specific number of times

c)

the same as if statements

d)

not part of programming

9.
To repeat until a particular condition is true use
a)
while loop
b)
for loop
c)
if loop
d)
indentation
10.

Which kind of loop would be used?


I need a program that will keep letting me add money to a piggy bank until I get to £100.

a)

FOR Loop

b)

WHILE Loop

11.

Which kind of loop would be used?


I need a program that will keep letting me add a monthly payment for 12 months.

a)

FOR Loop

b)

WHILE Loop

12.

Which kind of loop would be used?


I need a guessing game program that will let me keep guessing until I get the right answer.

a)

FOR Loop

b)

WHILE Loop

13.

Which kind of loop would be used?


I need a revision program that will run through revision questions 4 times.

a)

FOR Loop

b)

WHILE Loop

14.

What is a Count-Controlled loop?

a)

for loop

b)

while loop

15.

A count controlled loop will..

a)

Repeat code until a condition is met

b)

Repeat code a specific amount of times

c)

Repeat code a random amount of times

d)

None of the above

16.

Which of these is NOT a loop in python?

a)

for loop

b)

while loop

c)

nested loop

d)

if loop

17.

Which of these operators means EQUAL TO?

a)

'='

b)

'=>'

c)

'<='

d)

'=='

18.

Which of these will allow me to count from 0-20 in steps of 5?

a)

for x in range(0,20):

print(x)

b)

while x = (0,20,5):

print(x)

c)

for x in range(0,21,5):

print(x)

d)

for x in range(0,21,5):

print(y)

19.

If i want to continuously check for a correct answer, what loop would i use?

a)

for loop

b)

while loop

20.
What are the two main types of loops that we have learned about in Python?
a)
IF Function & Variables
b)
FOR and WHILE Loops
c)
Forever and Fixed Loop
d)
Data Types and Numbers
21.
What type of loop is used when you know how many times you want to repeat something?
a)
A WHILE Loop
b)
An IF function
c)
A FOR Loop
d)
A Variable
22.
What type of loop is used when you DO NOT know how many times you want to repeat something?
a)
A WHILE Loop
b)
A Counter
c)
A FOR Loop
d)
A Forever Loop