list = [['apples', 'oranges', 'cherries', 'banana'],
['Alice', 'Bob', 'Carol', 'David'],
['dogs', 'cats', 'moose', 'goose']]
print(len(max(list[0])))
Output: 7
why is the output 7 and not 8?
when i modify the print statement to:
print(len(max(list[0], key = len)))
it works. I dont understand why. I hope someone can help me out.
thanks