+ 1

why does this happen in all programming languages

syntax here of python but logic is same: if 'ABC'<'AC' : print(true) else: print(false) comment down the reason:

12th Mar 2019, 4:15 PM
Utkarsh Dhiman
Utkarsh Dhiman - avatar
1 Answer
+ 3
Strings get compared letter by letter until one is bigger (according to ASCII or unicode depending on the language). first letters: A == A second letters: B<C So second string is bigger.
12th Mar 2019, 5:01 PM
HonFu
HonFu - avatar