Skip to content · ⁨コンテンツへスキップ⁩

Running total · ⁨累計合計⁩

English

Running total

Add up the list [5, 10, 20] one number at a time, printing the total after each step: 5, 15, 35.

Lines indented under the for run every time round the loop; a line after the loop runs only once. Here the print belongs inside the loop.

日本語

累計合計

リスト [5, 10, 20] の各要素を順に加算し、各ステップごとに合計を出力します: 5, 15, 35。

for の下にインデントされた行はループの各反復で実行され、ループの後に置かれた行は一度だけ実行されます。ここでは print はループの内側にあります。

Log in or create account · ⁨ログインまたはアカウント作成⁩

IGCSE, A-Level & AP