How to sort a list in descending order with Python

1 Answer

0 votes
lst = [3, 7, 8, 2, 0, 9, 5]
   
lst.sort(reverse=True)

print(lst)




'''
run:

[9, 8, 7, 5, 3, 2, 0]

'''

 



answered Aug 4, 2021 by avibootz

Related questions

...