Skip to content · ⁨Lompat ke konten⁩

Running total · ⁨Total berjalan⁩

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.

Bahasa Indonesia

Total berjalan

Jumlahkan daftar [5, 10, 20] satu angka pada satu waktu, cetak total setelah setiap langkah: 5, 15, 35.

Baris yang terindentasi di bawah for akan berjalan setiap kali putaran perulangan; sebuah baris setelah perulangan hanya berjalan sekali. Di sini print berada di dalam perulangan.

Log in or create account · ⁨Masuk atau buat akun⁩

IGCSE, A-Level & AP