decreasing for in python code example
Example 1: python for loop backwards
for i in range(len(item)-1, -1, -1):
print(item[i])
Example 2: 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