Sort list of strings by integer suffix in python
<p>I have a list of strings:</p>

<pre><code>[song_1, song_3, song_15, song_16, song_4, song_8]
</code></pre>

<p>I would like to sort them by the # at the end, unfortunately since the lower numbers aren't "08" and are "8", they are treated as larger than 15 in lexicographical order.</p>

<p>I know I have to pass a key to the sort function, I saw this somewhere on this site to sort decimal numbers that are strings:</p>

<pre><code>sorted(the_list, key=lambda a:map(int,a.split('.'))
</code></pre>

<p>But that was for "1.2, 2.5, 2.3" but I don't have that case. I thought of replacing '.' with '_' but from what I understand it converts both sides to ints, which will fail since the left side of the _ is a string.</p>

<p>Any help would be appreciated</p>

<p><strong>EDIT</strong>: I forgot to mention that all the prefixes are the same (song in this example)</p>
