Quiz Complete, well Done!
Loop
What does the 'range' function do in a 'for' loop?
Iteration
Control flow
In a for loop, which part specifies the number of iterations?
The
statement can be used to exit a loop before it has been completely executed.
What is the purpose of the 'continue' keyword in a loop?
Which of the following is the correct syntax for a 'while' loop?
Definite Iteration
The second value in the range function represents the
value of the iteration (exclusive).
The keyword used to terminate a for loop prematurely is
.
The third value in the range function represents the
value of the iteration.
Typically, the number of iterations in a for loop is defined by the length of the
.
What is the output of the following code?
for i in range(2, 6):
print(i)
What is the purpose of a 'for' loop?
What is the purpose of a for loop?
Which of the following is an example of a nested 'for' loop?
Nested Loop
In Python, a for loop automatically handles the
of the loop variable.
Which keyword is used to initiate a 'for' loop in Python?