1
1

More than 3 years have passed since last update.

continue

Last updated at Posted at 2020-01-03
count = 0

while True
    if count == 5:
        break

    if count == 2:
        count += 1
        continue

    print(count)
    count += 1
実行結果
0
1
3
4
if count == 2:
    count += 1
    continue

continueで

print(count)
count += 1

をとばして
while内の1行目

if count == 5:

に行く。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1