fork(1) download
  1. def regras(x):
  2. if x < 100:
  3. if x % 2 == 0:
  4. return x
  5. else:
  6. return (x + x)
  7.  
  8. lista = [100, 200, 1000, 3000, 2, 3, 4, 5, 6, 7, 8]
  9. print(list(filter(regras,lista)))
  10.  
  11. #https://pt.stackoverflow.com/q/321682/101
Success #stdin #stdout 0.03s 9352KB
stdin
Standard input is empty
stdout
[100, 200, 1000, 3000, 2, 4, 6, 8]