When we execute the program print('a' > 'b') it gives us the answer False.
When we execute the program print('a' > 'A') it gives us the answer True.
Please help me with a detailed explanation.
when comparing characters using the < or > it converts it to an integer.
according to ASCII Table
Meaning:
therefor:
print('a' > 'b') is false because print(97 > 98)
and then:
print('a' > 'A') is true because print(97 > 65)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With