fork download
  1. a = map(int, input().split())
  2.  
  3. ok = []
  4. no = []
  5.  
  6. for x in a:
  7. (ok if x > 0 else no).append(x)
  8.  
  9. print(ok)
  10. print(no)
Success #stdin #stdout 0.02s 9260KB
stdin
1 2 0 -7 8 11 -777 874 -999 -7
stdout
[1, 2, 8, 11, 874]
[0, -7, -777, -999, -7]