Skip to content · ⁨Saltar al contenido⁩

Running total · ⁨Total acumulado⁩

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.

Español

Suma acumulada

Agregue la lista [5, 10, 20] un número a la vez, imprimiendo el total después de cada paso: 5, 15, 35.

Las líneas indentadas bajo el for se ejecutan en cada vuelta del bucle; una línea después del bucle se ejecuta solo una vez. En este caso, el print pertenece dentro del bucle.

Log in or create account · ⁨Iniciar sesión o crear cuenta⁩

IGCSE, A-Level & AP