print a reverse list in python code example
Example 1: reverse element in a list in python 3
my_list = [1, 7, 9, 11, 12, 20]
# Reverse a list by using a slice
print(my_list[::-1])
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