+ 1

Can someone explain why print("abe" > "Abe") is true?

16th Nov 2020, 9:10 AM
Abraham Kabui
Abraham Kabui - avatar
4 Answers
+ 4
When comparing string, it compares every char's ASCII value. In general, lower case is always have a greater ASCII value than upper case.
16th Nov 2020, 9:14 AM
äœ çŸ„é“èŠć‰‡ïŒŒæˆ‘äčŸæ˜Ż
äœ çŸ„é“èŠć‰‡ïŒŒæˆ‘äčŸæ˜Ż - avatar
+ 2
ascii of "a" = 97 ascii of "A" = 65 97 > 65 = True
18th Nov 2020, 6:57 AM
Shen Bapiro
Shen Bapiro - avatar
0
Very helpful, thanks
16th Nov 2020, 10:12 AM
Abraham Kabui
Abraham Kabui - avatar