Quiz Complete, well Done!
What is the output of the following code?
i = 5
while i > 0:
print(i)
if i == 3:
continue
i -= 1
Infinite loop
In
iteration, the number of iterations is not known in advance.
How do you exit an infinite loop?
What is the purpose of the break statement in programming?
Continue statement
In which direction does the control flow transfer when a 'break' statement is encountered?
While loop
What happens if the condition of a while loop is never true?
What is the output of the following code?
i = 10
while i > 0:
print(i)
i -= 2
A
loop is an example of indefinite iteration.
Which programming language supports the break statement?
Which programming construct is commonly used with the 'continue' statement?
Loop
A for loop is an example of
iteration where the number of iterations is known in advance.
Indefinite Iteration
What is a while loop?
What is the purpose of a while loop?
What is the syntax of a while loop?
For loop