Advertisement
jumboframe

Untitled

Jun 28th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. def sum_even(a):
  2.     rez = 0
  3.     for j in a:
  4.         if int(j) & 1 == 0:
  5.             rez += int(j)
  6.     return (rez)
  7.  
  8.  
  9. def sum_odd(a):
  10.     rez = 0
  11.     for j in a:
  12.         if int(j) & 1 == 1:
  13.             rez += int(j)
  14.     return (rez)
  15.  
  16.  
  17. n = input()
  18. if n[0] == "-":
  19.     line = n[1:]
  20. else:
  21.     line = n
  22.  
  23. result = sum_odd(line) * sum_even(line)
  24. print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement