Max Value in a List of Strings | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Max Value in a List of Strings

If you use the 'max' function on a list of values that are strings, does it return the value with the most letters? I want to make sure I understand what this function would do in a list of string values. Thanks in advance!

3rd Jul 2020, 7:09 PM
Brian Braddock
Brian Braddock - avatar
3 Answers
+ 6
No, it orders the words alphabetically and returns the one that is at the bottom of the alphabetic list
3rd Jul 2020, 7:21 PM
Julia Shabanova
Julia Shabanova - avatar
+ 4
...but you can get it to do that if you need.
3rd Jul 2020, 7:30 PM
rodwynnejones
rodwynnejones - avatar
+ 2
thank you both!
3rd Jul 2020, 7:31 PM
Brian Braddock
Brian Braddock - avatar