invert list code example
Example 1: how to reverse a list in python
my_list = [1, 2, 3, 4, 5]
my_list.reverse()
Example 2: python reverse list
list.reverse()
Example 3: reverse list python
list=[1,2,3]
list[::-1]
my_list = [1, 2, 3, 4, 5]
my_list.reverse()
list.reverse()
list=[1,2,3]
list[::-1]