while 循环

零基础也能学的机器学习编程——只要会打字,就能开始

假设你想从十倒数到一,就像火箭发射前那样。没有人会靠打字解决这件事,先打 print(10),再打 print(9),再打 print(8),把同一行手动复制九次。那不是编程,那是抄写,而且浪费了计算机真正擅长的那一件事:一遍又一遍毫无怨言地做同一件小事。

🔒 This is a Pro lesson — the interactive figure, worked examples, quiz and practice open with Pro access.

▶ while 循环
← 小小的决定,大大的程序for 循环与 range() →