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

Add up one to five · ⁨1から5までの合計⁩

Add up one to five

Use a for loop to add 1 + 2 + 3 + 4 + 5 into total.

range(1, 6) gives 1 to 5: it starts at the first number and stops before the second. Add each one onto a total that starts at 0.

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

IGCSE, A-Level & AP