Advertisement
Spocoman

04. Number Classification

Feb 11th, 2022
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. numbers = list(map(int, input().split(', ')))
  2.  
  3. print(f'Positive: {[x for x in numbers if x >= 0]}')
  4. print(f'Negative: {[x for x in numbers if x < 0]}')
  5. print(f'Even: {[x for x in numbers if x % 2 == 0]}')
  6. print(f'Odd: {[x for x in numbers if x % 2 == 1]}')
  7.  
  8.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement