I need to write a loop that traverses the list and prints the length of each element. So far I have this:
def countEachElement():
elements= ["spam!",'1',['Brie','Roquefort','Pol le Veq'],['1','2','3']]
i=0
while i < len(elements):
print len(elements[i])
i=i+1
But it's not counting each element of the lists inside the list. What should I do?