In order to sort a list of elements in descending order, we can make use of the sort() method by passing the option reverse=True
Example:list_of_numbers = [22, 45, 245, 64, 345, 66, 33, 68, 24, 27, 78]
list_of_numbers.sort(reverse=True)
print(list_of_numbers)
Output:
[345, 245, 78, 68, 66, 64, 45, 33, 27, 24, 22]

Read Documentaion:
List Objects - List.sort(): https://docs.python.org/3/library/stdtypes.html#list.sort
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!