When comparing strings, how do you calculate the maximum of them which has the highest ASCII value? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

When comparing strings, how do you calculate the maximum of them which has the highest ASCII value?

For instance, in python, print(max(SoloLearn) outputs "r"

12th Mar 2019, 5:19 AM
eMBee
eMBee - avatar
9 Answers
+ 3
Mofey Those are their ASCII values. https://ascii.cl
12th Mar 2019, 5:46 AM
Diego
Diego - avatar
+ 10
Mofey for example try print(ord('a')) it give you ascii number of symbol.
12th Mar 2019, 6:26 AM
Николай Шаповаленко
Николай Шаповаленко - avatar
+ 8
Mofey second thing print(chr(97))
12th Mar 2019, 7:07 AM
Николай Шаповаленко
Николай Шаповаленко - avatar
+ 5
Oh, alright, at least I can say I've learnt one new thing today thanks Jay Matthews and Николай Шаповаленко
12th Mar 2019, 7:05 AM
eMBee
eMBee - avatar
+ 4
Oh, thanks Diego, I never knew of those
12th Mar 2019, 5:48 AM
eMBee
eMBee - avatar
+ 3
Didn't you just answer your own question?
12th Mar 2019, 5:26 AM
Diego
Diego - avatar
+ 3
Diego what I meant is how to actually calculate it where you say a=97, e=101, how exactly do you get those figures?
12th Mar 2019, 5:38 AM
eMBee
eMBee - avatar
+ 1
<<< ( )
24th Apr 2019, 9:33 PM
Quentin Blue
Quentin Blue - avatar