fork download
  1. def nomes(x):
  2. nome = []
  3. for i in x:
  4. if len(i) == 4:
  5. nome.append(i)
  6. return nome
  7.  
  8. print(nomes(["abc", "jose", "ana", "maria", "joao", "abcd"]))
  9.  
  10. #https://pt.stackoverflow.com/q/314030/101
Success #stdin #stdout 0.04s 9292KB
stdin
Standard input is empty
stdout
['jose', 'joao', 'abcd']