I know that this sounds trivial but I did not realize that the sort() function of Python was weird. I have a list of \"numbers\" that are actually in string for
You could pass a function to the key parameter to the .sort method. With this, the system will sort by key(x) instead of x.
list1.sort(key=int)
BTW, to convert the list to integers permanently, use the map function
list1 = list(map(int, list1)) # you don't need to call list() in Python 2.x
or list comprehension
list1 = [int(x) for x in list1]