python for i in range backwards code example
Example 1: python for loop backwards
for i in range(len(item)-1, -1, -1):
print(item[i])
Example 2: for i in range start
for i in range([start], stop[, step])
Example 3: 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 4: python reverse for loop
rop = input('Type a three or more word or code.')
t = len(rop)
j = ''
for i in range(t-1,-1,-1):
j = j+rop[i]
print(j)