0
is there any built in function in python to sort a list of integers?
3 Answers
+ 4
a = [1,4028,-2828,19,42,0]
a.sort() #sort list a.
+ 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 âïž
+ 1
Yes there is this function
List.sort() = sort in ascending order
List.sort(reverse=True)=sort in descending order