sorted(L, key=lambda v: (v[:1],int(v[1:])))

would do the trick. In general, you could look at something like 
https://pypi.org/project/natsort/. It might be able to make a more natural 
sortkey in more examples (in general, the idea would be to split your 
string in alphabetic and numerical substrings and make a tuple of strings 
and integers out of it and sort that).

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to