Count to ten · 数到十
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
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:它在第二个数之前停下,所以要仔细选择这个数。
Use a for loop to print the numbers 1 to · 到 10, one per line. · 用 for 循环打印 1 到 10,每个数一行。
Click Run to see the output here. · 点击“运行”查看此处输出。