Advertisement
jumboframe

Untitled

Jun 28th, 2018
131
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) % 2 == 0:
  5.             rez += int(j)
  6.     return (rez)
  7.  
  8. def sum_odd(a):
  9.     rez=0
  10.     for j in a:
  11.         if int(j) % 2 != 0:
  12.             rez += int(j)
  13.     return (rez)
  14.  
  15. n = input()
  16. if n[0] == "-":
  17.     line = n[1:]
  18. else:
  19.     line = n
  20.  
  21. result = sum_odd(line) * sum_even(line)
  22. print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement