I am trying to sort the following data in a CSV file:
list_all = ["10","2","113.2","200"]
Sounds simple, right? So I use the following codes to sort it:
list_all = ["10","2","113.2","200"]
sortedlist = sorted(list_all)
print(sortedlist)
But it doesn't work properly.
This is the output from my function.
['10', '113.2', '2', '200']
Apparently, it is sorted by the first word in each string only, which is weird. How to solve this?