function reverse to python code example
Example 1: how to reverse a string in python
belief = "the world is mine, hello"[::-1]
print(belief)
Example 2: reverse python3
arr = [2,5,32,86,4,131,97]
# reverse without modifying input, using range:
for i in range(len(arr)-1, -1, -1):
print(arr[i])
# reverse and modifying input:
arr.reverse()