0

is there any built in function in python to sort a list of integers?

29th Sep 2020, 10:59 AM
WaYR🇧🇩
WaYR🇧🇩 - avatar
3 Respuestas
+ 4
a = [1,4028,-2828,19,42,0] a.sort() #sort list a.
29th Sep 2020, 11:01 AM
你知道規則,我也是
你知道規則,我也是 - avatar
+ 4
Example - x=[1,2,3,4,5] x.sort() Now this will list the items from the list(list of x) Hope this helps ✌️
29th Sep 2020, 11:09 AM
Piyush
Piyush - avatar
+ 1
Yes there is this function List.sort() = sort in ascending order List.sort(reverse=True)=sort in descending order
29th Sep 2020, 11:43 AM
Ajay