fork download
  1. a = [-10, 27, 1000, -1, 0, -30]
  2. b = list(filter(lambda x: x >= 0, a))
  3. c = [x for x in a if x >= 0]
  4.  
  5. print(b)
  6. print(c)
Success #stdin #stdout 0.01s 7244KB
stdin
Standard input is empty
stdout
[27, 1000, 0]
[27, 1000, 0]