print the numbers 1-10 counting backwards in a range python code example
Example 1: how does the range function work in python when counting down
range(4)
#considers numbers 0,1,2,3
range(1, 4)
#considers numbers 1,2,3
range(1, 4, 2)
#considers numbers 1,3
range(4, 1, -1)
#considers numbers 4,3,2
Example 2: reverse for loop in python
for i in range(10, -6, -2):
print(i)