1
I am trying to solve the following problem: from a list of names, I need to return only the names with len
4.
I wrote the code below but apparently the loop is not working since, in a list with 4 names, being two 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
Thank you very much, my friend.
– P. Sampaio