How to sort a list of strings in descending order with Python

1 Answer

0 votes
lst = ['python', 'java', 'c++', 'c', 'php']

lst.sort(reverse=True)

print(lst)



'''
run:

['python', 'php', 'java', 'c++', 'c']

'''

 



answered Jan 10, 2021 by avibootz

Related questions

1 answer 191 views
1 answer 259 views
1 answer 289 views
...