how to sort items in a list alphabetically by the letters in their respective names.
<p>I am trying to sort values in a list by the letters in their name: I want, for example,  ["8a", "8c", "8b", "8d"] to become ["8a", "8b","8c", "8d"]. Does this have something to do with a key?</p>

<p>The .sort() method for lists has been mentioned; there's a sorting function that takes the list as an argument, and returns a sorted list without modifying the list in place:</p>

<pre><code>&gt;&gt;&gt; mylist = ["8a", "8c", "8b", "8d"]
&gt;&gt;&gt; sorted(list)
['8a', '8b', '8c', '8d']
&gt;&gt;&gt; mylist
['8a', '8c', '8b', '8d']
</code></pre>

python