Add up one to five · 一加到五
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · 此页面需较新浏览器(支持 SharedArrayBuffer)。请升级 Chrome、Edge、Firefox 或 Safari 至最新版本。
This one builds on a lesson you haven't finished yet. Do that lesson first: · 此任务基于您尚未完成的课程。请先完成以下课程:
Python Basics · Python 基础 · Counting loops · 计数循环 →
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 开始的总和上。
Use a for loop to add 1 + 2 + 3 + 4 + 5 into total. · 用 for 循环把 1 + 2 + 3 + 4 + 5 累加进 total。
Click Run to see the output here. · 点击“运行”查看此处输出。