Skip to content

Liftoff · ⁨发射⁩

English

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.

中文

发射

从 5 倒数到 1,然后打印 Liftoff!。

while 循环只要条件为真就一直重复,所以循环内部必须改变变量,否则它永远不会停下。写在循环后面、没有缩进的代码,会在循环结束时运行一次。

Log in or create account · ⁨登录或创建账户⁩

IGCSE, A-Level · ⁨IGCSE、A-Level⁩ & AP · ⁨与 AP⁩