1>>> the_list = [1,2,3]
2>>> reversed_list = the_list.reverse()
3>>> list(reversed_list)
4[3,2,1]
5
6OR
7
8>>> the_list = [1,2,3]
9>>> the_list[::-1]
10[3,2,1]
1
2# ----------- HOW TO REVERSE AN ORDERED LIST ----------- #
3
4myList = [-1, 3, 8, 2, 9, 5]
5sorted(myList,reverse=True)
6
7>>> [9, 8, 5, 3, 2, -1]
8
9OR
10
11order_list = sorted(input1)
12order_list[::-1]
13
14>>> [9, 8, 5, 3, 2, -1]
15
1def reverse_sublist(lst,start,end):
2 lst[start:end] = lst[start:end][::-1]
3 return lst