How to compare “6” with something like”@“? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to compare “6” with something like”@“?

When we compare a string that contains numbers or capitalization or special syntax, what would the Boolean value be?

21st Aug 2020, 7:11 AM
Shidi Yin
Shidi Yin - avatar
2 Answers
+ 6
Python, right? If the string is exactly equal: True. Otherwise False.
21st Aug 2020, 7:12 AM
HonFu
HonFu - avatar
+ 2
ord('6') = 54 ord('@') = 64 so '6' < '@'
21st Aug 2020, 8:00 AM
[][]