繰り返し 2

break

break を使うと、処理の途中で、ループを終了することができます。

count = 0

while True:
    count = count + 1

    if count >= 100:
        # もし count が 100 より
        # 大きくなったらループを終了する
        break

    print(count)

print('end !')

continue

continue を使うと、処理の途中で、次のループの処理に入ることができます。

count = 0

while True:
    input()
    count = count + 1

    if count % 2 == 0:
        # もし偶数なら表示せず
        # 次のループに向かう
        continue

    print(count)