Advertisement
STANAANDREY

Untitled

Jan 19th, 2023
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. def getEvenDigitsSum(nr):
  2. if nr == 0:
  3. return 0
  4.  
  5. digit = nr % 10
  6. if digit % 2 == 0:
  7. return digit + getEvenDigitsSum(nr // 10)
  8. return getEvenDigitsSum(nr // 10)
  9.  
  10. def repElemWithEvenDigsSum(l):
  11. return list(map(getEvenDigitsSum, l))
  12.  
  13. print(repElemWithEvenDigsSum([3472, 1111, 2222, 123]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement