>>> "python" > "chocolate" this would print out as True, but I don't understand how alphabetically works
in the syntax
"python" > "chocolate"
this would print out as True, but I don't understand how alphabetically this works. I'm confused by the terminology.
Elias Flores905 Points
I had this question too and after some research, this is what I've found:
Python is comparing the ASCII decimal(Dec) value of the first characters ("p" and "c" respectively) of the string. You can look at the table of the ASCII characters here:
"p" has a Dec value of 112 while "c" has a Dec value of 99, and as you can guest 112 > 99 returns
Ahhh ok, that makes more sense . Thank so much!!!
Craig DennisTreehouse Teacher
P comes after C in the alphabet...picture the letters laid out left to right in order.