Hey everyone. I have a list in python like:
When I try and sort this list I get the sorting that you would get if you typed ls in a unix directory:Code:['file-1', 'file-9', 'file-2', 'file-10']
where 10 comes after 1 but before 2. I would like to sort this list such that 10 comes after 9 like:Code:['file-1', 'file-10', 'file-2', 'file-9']
Is there a simple way to do this with python? Thanks.Code:['file-1', 'file-2', 'file-9', 'file-10']
Bookmarks