Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. """Remove negative nums and sort."""
  2. user_input = input()
  3. old_nums = user_input.split()
  4. new_nums = []
  5. for num in old_nums:
  6. new_num = int(num)
  7. if new_num >= 0:
  8. new_nums.append(new_num)
  9. new_nums.sort()
  10. for num in new_nums:
  11. print(num, end=' ')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement