kostovhg

Number Classification

Aug 8th, 2021
966
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. nums = [int(x) for x in input().split(', ')]
  2. cra = {'Positive': lambda x: x >= 0, 'Negative': lambda x: x < 0, 'Even': lambda x: not x % 2, 'Odd': lambda x: x % 2}
  3. [print(f"{c}: {', '.join(str(n) for n in nums if cra[c](n))}") for c in cra.keys()]
RAW Paste Data