fork(1) download
  1. def filtro(lista, predicado, acao):
  2. for item in lista:
  3. if predicado(item):
  4. acao(item)
  5.  
  6. funcao = lambda x: filtro(x, lambda y: y > 0, lambda z: print(z))
  7.  
  8. funcao([10, -20, 30])
  9.  
  10.  
Success #stdin #stdout 0.02s 8736KB
stdin
Standard input is empty
stdout
10
30