python backwars code example
Example 1: inverted for python
for i in reversed(range(5)):
print(i)
Example 2: reverse string in python
'hello world'[::-1]
'dlrow olleh'
for i in reversed(range(5)):
print(i)
'hello world'[::-1]
'dlrow olleh'