Max string | SoloLearn: Learn to code for FREE!

+2

Max string

print(max("Sololearn")) //r Why????

5/24/2019 7:26:31 AM

Leon KV

10 Answers

New Answer

+4

Because character 'r' is the one with highest numeric point of all the characters in a string "SoloLearn".

+3

devisfun Because 'n' numeric point is less than 'r' mate. Even ASCII table tells you that clearly : )

+2

It's about the position in alphabet. Value of 'a' is 97, 'b' is 98, and so on.

+1

Ipang that’s interesting, why would it not be ‘n’?

+1

Ah i understand now; i didn’t understand what you were referring to by ‘numeric point’ 😅

+1

Luk but in my alphabet 'r' is before 's' or is it because 'r' is small and 'S' is a big letter?

+1

Leon KV Yes, it is as you said . http://www.asciitable.com

+1

https://code.sololearn.com/c2HGSk7p3a0U/?ref=app

0

Is there no context between the alphabet and the numeric point?

0

Luk okay thanks