reverse elements in an array python code example
Example 1: reverse array python
>>> array=[0,10,20,40]
>>> for i in reversed(array):
... print(i)
Example 2: python how to invert an array
revArray = list(reversed(array))
>>> array=[0,10,20,40]
>>> for i in reversed(array):
... print(i)
revArray = list(reversed(array))