a = map(int, input().split()) ok = []no = [] for x in a: (ok if x > 0 else no).append(x) print(ok)print(no)
1 2 0 -7 8 11 -777 874 -999 -7
[1, 2, 8, 11, 874] [0, -7, -777, -999, -7]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!