why python is giving output like this:
>>> 'apple' > 'T'
True
>>> 'apple' > 't'
False
It should be True for both cases.right?
Edit:
I got the Idea of ASCII Table.Thanks!!
Now what about this.Is 11.1 is being treated as '11.1'?
>>> 'apple' > 11.1
True
Because a
comes after T
in the ASCII character set, but before t
.
The decimal ASCII encoding of these letters:
T
is 84.a
is 97.t
is 116.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