Behaviour of raw_input()

raw_input returns a string. So use int(raw_input()).

And for how string and int comparsions work, look here.


See the answer here.

Basically you're comparing apples and oranges.

>>> type(0) < type('10')
True
>>> 0 < '10'
True
>>> type(0) ; type('10')
<type 'int'>
<type 'str'>