python reverse lst code example
Example 1: how to reverse a list in python
my_list = [1, 2, 3, 4, 5]
my_list.reverse()
Example 2: index and reversing a sub list in python list
def reverse_sublist(lst,start,end):
lst[start:end] = lst[start:end][::-1]
return lst