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
sort()
Python's sort isn't weird. It's just that this code:
for item in list1: item=int(item)
isn't doing what you think it is - item is not replaced back into the list, it is simply thrown away.
item
Anyway, the correct solution is to use key=int as others have shown you.
key=int