Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

U7/ L2 HS Kira- Loops and Lists - For Loops

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

Which of the following is a fact you might learn from a lesson about for loops?

a)

For loops are used to repeat a block of code a specific number of times.

b)

For loops are only used for sorting data.

c)

For loops cannot be used in programming.

d)

For loops are used to store data permanently.

2.

A __________________ __________________ is used to repeat a block of code a specific number of times.

a)

for loop

b)

if statement

c)

switch case

d)

function call

3.

The keyword used to start a for loop in Python is _________________

a)

for

b)

loop

c)

start

d)

begin

4.

For loops often use the built-in ________________ function in Python to define the number of iterations.

a)

range

b)

list

c)

input

d)

print

5.

A for loop has three main parts: the ________________ value, the ________________ value, and the ________________ (change between iterations).

a)

start, end, increment

b)

begin, end, increment

c)

initial, final, update

d)

first, last, change

6.

The ________________ determines how much the loop variable increases (or decreases) each time the loop runs.

a)

increment

b)

limit

c)

condition

d)

index

7.

If no increment is given, the default value in a range() function is _________________

a)

1

b)

0

c)

2

d)

-1

8.

The ________________ point tells the loop where to begin counting or iterating.

a)

start

b)

end

c)

middle

d)

break

9.

The ________________ point tells the loop where to stop (but this value is not included in the loop’s execution).

a)

end

b)

start

c)

break

d)

stop

10.

The statement for i in range(1, 6): will cause the loop to run ________________ times.

a)

5

b)

4

c)

6

d)

1

11.

You can make a for loop count backwards by using a ________________ increment (e.g., -1).

a)

negative

b)

positive

c)

zero

d)

random

12.

In the activity 'Swim Four Times,' the for loop repeats an action ________________ times.

a)

four

b)

two

c)

five

d)

three

13.

In 'Space Elevator – Going Down!,' the loop likely uses a range with a ________________ step to simulate descending.

a)

negative

b)

positive

c)

zero

d)

infinite

14.

Write a Python for loop that prints the numbers 10, 20, 30, 40, and 50.

a)

range(10, 51, 10)

b)

range(10, 50, 10)

c)

range(10, 60, 10)

d)

range(0, 51, 10)

15.

What will the following code output?

a)

Lift off! Lift off! Lift off!

b)

Lift off!

c)

Lift off! Lift off!

d)

Error