[Solved] How to divide the list and sort in ascending and descending order using python?


Try getting the half, then reverse:

>>> l=[1,2,3,4,5,6]
>>> l[len(l)//2:]=l[len(l)//2:][::-1]
>>> l
[1, 2, 3, 6, 5, 4]
>>> 

slicing + slicing + reversing.

1

solved How to divide the list and sort in ascending and descending order using python?