Lets say that I have a list of 3 tuples:
[(x, 5), (y, 10), (z, 7)]
I'd like to rearrange the listing of the items based on the 2nd element of each tuple from largest to smallest so the resulting list can look something like this:
[(y, 10), (z, 7), (x,5)]
I'm not as fluent in lists than other programming aspects in Python and I find resolving this difficult.
How can this be solved?