how to count number from 1 to 10 in python 1

how to count number from 1 to 10 in python

for i in range(11):
  print(i)

Here is what the above code is Doing:
1. We create a variable called i and set it to 0.
2. We check if i is less than 11.
3. If it is, we print i and then increment i by 1.
4. We repeat steps 2 and 3 until i is no longer less than 11.

Similar Posts