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() →