Skip to content · ⁨Pular para o conteúdo⁩

Add up one to five · ⁨Somar de um a cinco⁩

English

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.

Português

Somar de um a cinco

Use um loop for para somar 1 + 2 + 3 + 4 + 5 em total.

range(1, 6) vai de 1 até 5: começa no primeiro número e para antes do segundo. Some cada um a um total que começa em 0.

Log in or create account · ⁨Entrar ou criar conta⁩

IGCSE, A-Level & AP