Count down in twos · 每次减二倒数
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 down in twos
n starts at 10. Print 10, 8, 6, 4, 2 using a while loop.
The step does not have to be 1. Check where it stops: from 10 taking 2 each time, the value after 2 is 0, and 0 > 0 is false — so 0 is never printed.
中文
每次减二倒数
n 从 10 开始。用 while 循环打印 10、8、6、4、2。
步长不一定是 1。注意它在哪里停:从 10 每次减 2,2 之后是 0,而 0 > 0 不成立 —— 所以 0 不会被打印。
n starts at 10. Print 10, 8, 6, 4, 2 using a while loop. · n 从 10 开始。用 while 循环打印 10、8、6、4、2。
Click Run to see the output here. · 点击“运行”查看此处输出。