how to reverse in python code example
Example 1: reverse in python 3
number = [1,2,3,4,5]
number.reverse()
print(number)
Example 2: reverse list python
list=[1,2,3]
list[::-1]
Example 3: python reverse list
systems = ['Windows', 'macOS', 'Linux']
print('Original List:', systems)
reversed_list = systems[::-1]
print('Updated List:', reversed_list)
Example 4: reverse function python
Some_List = [1, 2, 3, 4, 1, 2, 6]
Some_List.reverse()
print(Some_List)
Example 5: reverse python3
arr = [2,5,32,86,4,131,97]
for i in range(len(arr)-1, -1, -1):
print(arr[i])
arr.reverse()