Python Land › Forums › The Python Tutorial › comparing digits and letters 1 >’a’ outputs an error › Reply To: comparing digits and letters 1 >’a’ outputs an error
January 30, 2021 at 9:29 am
#1631
Keymaster
Hi Lu,
Python tells you:
‘<‘ not supported between instances of ‘int’ and ‘str’
This means you can’t compare two different types in Python. You can compare numbers with numbers, and you can also compare letters with letters.
I can see why you tried though since I gave an example where I did exactly that. I updated the tutorial page because I meant to give the example ‘1’ < 'a' instead of 1 < 'a'.