Why the result of “bag” > “apple” is True in Python? I tried this code below i don't know why it show this result and how? Please some one explain it.
print("bag" > "apple")
True
Why the result of “bag” > “apple” is True in Python? I tried this code below i don't know why it show this result and how? Please some one explain it.
print("bag" > "apple")
True
I believe this is True
because Python compares the first letter of each word. And b
is greater than a
in Python.