Skip to content

Add up one to five · ⁨一加到五⁩

English

Add up one to five

Use a for loop to add 1 + 2 + 3 + 4 + 5 into total.

range(1, 6) gives 1 to 5: it starts at the first number and stops before the second. Add each one onto a total that starts at 0.

中文

一加到五

用 for 循环把 1 + 2 + 3 + 4 + 5 累加进 total。

range(1, 6) 给出 1 到 5:从第一个数开始,在第二个数之前停下。把每一个都加到一个从 0 开始的总和上。

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

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