Count up 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 基础 · While loops · while 循环 →
English
Count up to five
Use a while loop to print 1 to 5, one per line. Start n at 1.
Counting up needs n = n + 1 instead of n - 1, and a question that stops at the right place. n <= 5 lets 5 through; n < 5 would stop one early.
中文
数到五
用 while 循环打印 1 到 5,每个数一行。让 n 从 1 开始。
往上数要用 n = n + 1 而不是 n - 1,问题也要在正确的地方停下。n <= 5 会让 5 通过;n < 5 会提前一步停下。
Use a while loop to print 1 to · 到 5, one per line. Start n at 1. · 用 while 循环打印 1 到 5,每个数一行。让 n 从 1 开始。
Click Run to see the output here. · 点击“运行”查看此处输出。