I think this may be a rather simple question but I've searched other questions and haven't really found anything completely relevant.
Say I have a list containing a number of strings like
mylist = ['queen', 'jack', 'queen', 'king', 'jack']
Now, I want to sort the strings in this list based on their relative values. So let's say king = 3, queen = 2, jack = 1.
What is the simplest way to associate those values with the strings in the list and sort them accordingly?