somelist = [125, -25, 5, -1] print([int(x >= 0) for x in somelist])
Standard input is empty
[1, 0, 1, 0]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!