while

□未翻訳

□翻訳中

□翻訳完了(細田謙二)

■レビュー(Omi Chiba)

while

Pythonにおいてwhileループは他の多くのプログラミング言語と同じように、無限にループ処理を行い、また、各反復の前に条件のテストを行います。条件がFalseになると、ループは終わります。

The while loop in Python works much as it does in many other programming languages, by looping an indefinite number of times and testing a condition before each iteration. If the condition is False, the loop ends.

1.

2.

3.

4.

5.

>>> i = 0

>>> while i < 10:

i = i + 1

>>> print i

10

Pythonではloop...untilの構造は存在しません。

There is no loop...until construct in Python.