Print Numbers from 1 to 10

Print numbers from 1 to 10 using a loop.

Logic BuildingBeginner
Logic Building
# Print numbers 1 to 10
for i in range(1, 11):
    print(i)

Output

1
2
3
4
5
6
7
8
9
10

Use for loop with range function.

Key Concepts:

  • range(1, 11) generates numbers from 1 to 10
  • Loop variable i takes each value
  • Print each value in the loop