Hi, I am new to programming and I am currently in topic 3-1 Comparison Operators in Python Mastery.
In the video it shows that
print(bool(“bag” > “apple”))
print(bool(“bag” == “BAG”))
print(ord(“b”))
print(ord(“B”))
Results are
True
False
98
66
The question I want to ask is below:
print(bool(“bag” == “bat”))
Results
False
Why isn’t the result “True”?
What I understand is that, since the letter “b” comes after the letter “a”, that’s why the results are “True”.
And the order of the letter “B” should be smaller than the letter “b”, which results in “False” as we are comparing in equality.
And now, since “bag” and “bat” starts with the same letter “b”, shouldn’t it be equal?
Shouldn’t be the results “True”?
I tried to make my question understandable, please let me know if there is any questions regarding my query.
Thanks in advance!