Question on max() | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Question on max()

Can max() function work on a string? What i mean can it output the longest word on some sentence E.g names = ("Anthony","David", "Eva") # If i put max(names), will it print "Anthony"?

1st Sep 2021, 12:29 PM
Ervan
Ervan - avatar
3 Answers
+ 2
Ervan yes it will work but will check ASCII value of 1st character so Eva will be output.
1st Sep 2021, 12:32 PM
A͢J
A͢J - avatar
0
Im sorry but what is ASCII?
1st Sep 2021, 12:32 PM
Ervan
Ervan - avatar