a = [-10, 27, 1000, -1, 0, -30]b = list(filter(lambda x: x >= 0, a))c = [x for x in a if x >= 0] print(b)print(c)
Standard input is empty
[27, 1000, 0] [27, 1000, 0]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!