Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. def count_even_digits_spyr03_for(n, n_digits=None):
  2. count = 0
  3. for c in str(n):
  4. if c in "02468":
  5. count += 1
  6. return count
  7.  
  8. def count_even_digits_spyr03_sum(n, n_digits=None):
  9. return sum(c in "02468" for c in str(n))
  10.  
  11. def count_even_digits_spyr03_list(n, n_digits=None):
  12. return [c in "02468" for c in str(n)].count(True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement