Skip to content

Liftoff

Liftoff

Count down from 5 to 1, then print Liftoff!.

A while loop repeats as long as its condition is true, so something inside the loop must change the variable, or the loop never stops. Code written after the loop, without indentation, runs once when the loop ends.

Log in or create account

IGCSE, A-Level & AP