Explanation why the following bool is True

Please can someone explain to me why the following bool is True.

print( “3” > “13”)
True

as they are string it is probably about the ASCII code of the first character in each

1 Like

It has to do with the ASCII code of the character as @ilenia said , but also the fact that comparative operations on strings are done lexicographically. So:

"3" > "13"

Is taken as:

"3" > "1"

Which is converted to ASCII:

ord("3") > ord("1")

Hope that helps

2 Likes

Thank you very much guys