Quiz Complete, well Done!
Continue statement
What is the output of the following code?
i = 5
while i > 0:
print(i)
if i == 3:
continue
i -= 1
What is the output of the following code?
i = 4
while i < 10:
print(i)
if i == 7:
break
i += 1
Control flow
The range function is often used in
loops to iterate over a specific sequence of numbers.
In the context of the EdExcel Computer Science iGCSE course, where is the break statement used?
Which loop is ideal when the number of iterations is unknown?
Which programming language supports the break statement?
A do-while loop is an example of a loop with
condition.
In which direction does the control flow transfer when a 'break' statement is encountered?
A
loop is an example of indefinite iteration.
Infinite loop
While loop
The
statement allows skipping the rest of the current iteration and going to the next one.
The condition of a while loop is checked before each
.
What is the output of the following code?
i = 10
while i > 0:
print(i)
i -= 2
What happens if the condition of a while loop is never true?
What is the purpose of the break statement in programming?
loops occur when the condition of a while loop is always true.
Which programming construct is commonly associated with the 'continue' statement?