Stop at the first over fifty · 50を超えた瞬間に停止する
Stop at the first over fifty
n starts at 1. Keep adding 1 to it. As soon as n * n is more than 50, leave the loop with break. Print n afterwards.
break leaves the loop at once. ⚠️ It only works inside the loop, so the if that holds it must be indented under the while too — and the break indented once more, under the if. print(n) stays at the left, outside the loop, so it runs after the break.
n starts at 1. Keep adding 1 to it. As soon as n * n is more than 50, leave the loop with break. Print n afterwards. · n は 1 で始まります。1 を追加し続けましょう。n * n が 50 を超えた瞬間、break でループを脱出します。その後、n を出力してください。
Click Run to see the output here. · 実行ボタンをクリックして出力を確認してください。