[issue6955] Max() Not Working Properly

2009-09-20 Thread Benjamin Peterson
Benjamin Peterson added the comment: This is the way strings are compared. You can change this easily, though, using max(list_of_string_numbers, key=int). -- nosy: +benjamin.peterson resolution: -> wont fix status: open -> closed ___ Python tracker

[issue6955] Max() Not Working Properly

2009-09-20 Thread lovelygoo2
New submission from lovelygoo2 : >>> max(['34', '7']) '7' >>> #This happens because it is comparing strings. >>> #I have found a way to fix it though. >>> def Max(li): ...greatest=li[0] ...for item in li: ...for item2 in li: ...if int(item)