+ 5

Can you please explain the output of this code?

print("max(Sololearn"))

5th Mar 2020, 9:27 AM
APC (Inactive for a while)
APC (Inactive for a while) - avatar
3 Answers
+ 5
String are compared lexigraphically. https://code.sololearn.com/cL7WODssdXT9/?ref=app r has the largest value. Read Omkar's answer to this quiz for details: https://www.sololearn.com/post/254575/?ref=app
5th Mar 2020, 9:32 AM
Gordon
Gordon - avatar
+ 4
I am pretty sure that you meant this: print(max("Sololearn")) It returns the character with the highest ascii value, which in this case is "r". Lower case characters do have higher ascii values as upper case characters.
5th Mar 2020, 10:10 AM
Lothar
Lothar - avatar
+ 3
You are just printing each character in string: "max(Sololearn"
5th Mar 2020, 9:33 AM
Seb TheS
Seb TheS - avatar