Skip to content

Count to ten

Count to ten

Print the whole numbers from 1 to 10, each on its own line.

A for loop repeats its indented lines once for every value it is given. range(1, 4) gives 1, 2, 3: it stops before its second number, so choose that number with care.

Log in or create account

IGCSE, A-Level & AP