Sort a List In Descending Order:
Sorted method allows you to sort a list in Descending Order.
letters = ['a', 'b', 'c', 'd', 'e', 'f'] print(sorted(letters, reverse = True)) letters = ['g', 'h', 'i', 'j', 'k', 'l'] print(sorted(letters, reverse = True)) letters = ['m', 'n', 'o', 'p', 'q', 'r'] print(sorted(letters, reverse = True))
No comments:
Post a Comment