Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """Remove negative nums and sort."""
- user_input = input()
- old_nums = user_input.split()
- new_nums = []
- for num in old_nums:
- new_num = int(num)
- if new_num >= 0:
- new_nums.append(new_num)
- new_nums.sort()
- for num in new_nums:
- print(num, end=' ')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement