全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 While loop?

Definition 18.1 Primary & Middle School Computer Science · 第 18 章 — Repeating with while

A while loop repeats its block as long as a condition is true: while condition: followed by an indented block. The condition is checked before every turn; as soon as it is false, the loop stops and the program goes on after the block.

A while loop is a cycle with the test at its door: the block runs, then the program goes back to the test. If the test is false the very first time, the block never runs at all.
A while loop is a cycle with the test at its door: the block runs, then the program goes back to the test. If the test is false the very first time, the block never runs at all.
在原文中阅读 →