Skip to content

Count to ten · ⁨数到十⁩

English

Count to ten

Print the whole numbers from 1 to 10, each on its own line.

A for loop repeats its indented lines once for every value it is given. range(1, 4) gives 1, 2, 3: it stops before its second number, so choose that number with care.

中文

数到十

打印从 1 到 10 的整数,每个数占一行。

for 循环会对它得到的每一个值重复执行一次缩进的代码。range(1, 4) 给出 1、2、3:它在第二个数之前停下,所以要仔细选择这个数。

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

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