I've been having some issues with some code lately and thought I'd share with this amazing community!
I have a list of strings, that are also string-based lists, delimited by a special character ('~'). For example..
list1 = [
'0~A~Sometext',
'56~B~Sometext',
'3~A~Sometext',
'875~G~Sometext',
'54~V~Sometext',
'3~D~Sometext',
'20~S~Sometext',
'7~R~Sometext'
]
I would like to sort this list based off the first element in the string (0,56,3,875,etc...)
When I try to implement my own sorting algorithm or use Python's sort
, it doesn't output the correct order.