Python language basics 47: 2 ways to reverse the elements in a list
September 13, 2015 Leave a comment
Introduction
In the previous post we looked at 2 ways to sort the elements in a list. The sort function operated directly on the list and the sorted function accepted another list as an argument and returned a new list. You could use the sorted function in case you need an independent sorted list and leave the source intact.
In this post we’ll look at two ways to reverse the elements in a list.