36.7k views
4 votes
When max() function is used on lists of words, what does max() find? For example:

aList = ["bacon", "cheese", "nuggets", "donuts", "yogurt"]
print (max (aList))

User DannyA
by
4.1k points

1 Answer

6 votes

Answer:

The function max() would return the last item of the list in alphabetical order, so in this case, print(max(aList)) would return 'yoghurt'.

Hope this helps :)

User Jim Black
by
4.8k points