I am trying to solve the following problem: from a list of names, I need to return only names with len
4.
I wrote the code below but apparently loop is not working since in a list with 4 names, two being within the criteria, it only returns one.
def nomes(x):
for i in x:
y = len(i)
nome = []
if y == 4:
nome.append(i)
return nome