[Tutor] When max() doesn't work as expected

Lie Ryan lie.1296 at gmail.com
Fri Dec 4 06:49:32 CET 2009


On 12/4/2009 1:22 PM, Kent Johnson wrote:
> max() finds the 'largest' in sort order. Strings sort in dictionary
> order so the max of a list strings will be the one that comes last in
> dictionary order.\

To prevent confusion: When Kent said "dictionary order" it means 
real-life dictionary, the thick book where you find definitions of 
words, not python dictionary (which is basically unordered).



More information about the Tutor mailing list