Printing a list in reverse order in Python
We can reverse the order of a list in Python by using the
animals = ['cat', 'doge', 'bird']animals.reverse()print(animals)['bird', 'doge', 'cat']
Note that the
list.reverse() method simply reverses the order of the list, it does not sort backward alphabetically. This is a permanent change to the order of the original list.