Reputation:
I can print out the length of maximum length of the sublist with this below
print(len(max(list, key=len)))
Is there a simple way of finding all the length of sublists? For instance, if the sublists have
[1, 2, 3, 4, 5, 6, 7], [2]
I want to output
8
And if sublists have
[1, 2, 3, 4, 5, 6, 7], [2], [3]
then I want to output
9
Upvotes: 2
Views: 864