Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getEvenDigitsSum(nr):
- if nr == 0:
- return 0
- digit = nr % 10
- if digit % 2 == 0:
- return digit + getEvenDigitsSum(nr // 10)
- return getEvenDigitsSum(nr // 10)
- def repElemWithEvenDigsSum(l):
- return list(map(getEvenDigitsSum, l))
- print(repElemWithEvenDigsSum([3472, 1111, 2222, 123]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement