Answers for "python sort list in reverse"

11

python sort list in reverse

#1 Changes list
list.sort(reverse=True)
#2 Returns sorted list
sorted(list, reverse=True)
Posted by: Guest on May-25-2020
1

print list in reverse order python

languages = ['C++', 'Python', 'Scratch']
#Method1:
languages.reverse()
print(languages)
#Method2:
lang = languages[::-1]
print(lang)
Posted by: Guest on January-24-2021
4

sorting python array

sorted(list, key=..., reverse=...)
Posted by: Guest on September-23-2019

Python Answers by Framework

Browse Popular Code Answers by Language