Q:

Print biggest len of several lists

I have several lists in one list and I want to compare the length of the lists and print the list with biggest number of len.
example:
somelist = [['a','b','c'],['a','b']]

the first list has a bigger len (3) than the second list (2), how do I print this in python? 

A:

Use the max() function with a generator expression:
max(len(l) for l in somelist)

This calculates the length for each sublist and returns the largest one.
If instead you wanted to extract the list with the longest length itself (so ['a', 'b', 'c'] rather than 3, use len as the key argument:
max(somelist, key=len)

Demo:
>>> somelist = [['a', 'b', 'c'], ['a', 'b']]
>>> max(len(l) for l in somelist)
3
>>> max(somelist, key=len)
['a', 'b', 'c']

