# there are two types of lists
# returns new list
sorted(list_name, reverse=True)
# changes list in place
list_name.sort(reverse=True)
#1 Changes list
list.sort(reverse=True)
#2 Returns sorted list
sorted(list, reverse=True)
>>> lst = [1, 2, 3, 4, 5]
>>> lst[::-1]
[5, 4, 3, 2, 1]
languages = ['C++', 'Python', 'Scratch']
#Method1:
languages.reverse()
print(languages)
#Method2:
lang = languages[::-1]
print(lang)
>>> xs = [0, 10, 20, 40]
>>> for i in reversed(xs):
... print(i)
for i in range(len(collection)-1, -1, -1):
print collection[i]
# print(collection[i]) for python 3. +
# create a list of prime numbers
prime_numbers = [2, 3, 5, 7]
# reverse the order of list elements
prime_numbers.reverse()
print('Reversed List:', prime_numbers)
# Output: Reversed List: [7, 5, 3, 2]