fork download
  1. # your code goes here
  2. elements = map(int, input().split())
  3. my_list = [e for e in elements if e >= 0]
  4. my_list.sort()
  5. print(my_list)
  6.  
Success #stdin #stdout 0.02s 9316KB
stdin
10 -7 4 39 -6 12 2
stdout
[2, 4, 10, 12, 39]