WorksheetsU7/ L2 HS Kira- Loops and Lists - For Loops
Total questions: 15
Worksheet time: 8mins
Which of the following is a fact you might learn from a lesson about for loops?
For loops are used to repeat a block of code a specific number of times.
For loops are only used for sorting data.
For loops cannot be used in programming.
For loops are used to store data permanently.
A __________________ __________________ is used to repeat a block of code a specific number of times.
for loop
if statement
switch case
function call
The keyword used to start a for loop in Python is _________________
for
loop
start
begin
For loops often use the built-in ________________ function in Python to define the number of iterations.
range
list
input
A for loop has three main parts: the ________________ value, the ________________ value, and the ________________ (change between iterations).
start, end, increment
begin, end, increment
initial, final, update
first, last, change
The ________________ determines how much the loop variable increases (or decreases) each time the loop runs.
increment
limit
condition
index
If no increment is given, the default value in a range() function is _________________
1
0
2
-1
The ________________ point tells the loop where to begin counting or iterating.
start
end
middle
break
The ________________ point tells the loop where to stop (but this value is not included in the loop’s execution).
end
start
break
stop
The statement for i in range(1, 6): will cause the loop to run ________________ times.
5
4
6
1
You can make a for loop count backwards by using a ________________ increment (e.g., -1).
negative
positive
zero
random
In the activity 'Swim Four Times,' the for loop repeats an action ________________ times.
four
two
five
three
In 'Space Elevator – Going Down!,' the loop likely uses a range with a ________________ step to simulate descending.
negative
positive
zero
infinite
Write a Python for loop that prints the numbers 10, 20, 30, 40, and 50.
range(10, 51, 10)
range(10, 50, 10)
range(10, 60, 10)
range(0, 51, 10)
What will the following code output?
Lift off! Lift off! Lift off!
Lift off!
Lift off! Lift off!
Error
