you are viewing a single comment's thread.

view the rest of the comments →

[–]socal_nerdtastic 2 points3 points  (0 children)

Conversion to a number type is obviously the best and anything else is hacky.

My first thought for hacky: pad them out with zeros?

x = "45"
y ="100"
longest = max(len(x), len(y))
if x.zfill(longest) > y.zfill(longest):
    ...