daniil-vlasenko

8.8

Aug 9th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.14 KB | None | 0 0
  1. def summa(a):
  2. s = 0
  3. while a:
  4. d = a % 10
  5. a = a // 10
  6. if d % 2 == 0:
  7. s += d
  8. return s
  9.  
  10. a = int(input())
  11. print(summa(a))
Advertisement
Add Comment
Please, Sign In to add comment