Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def count_even_digits_spyr03_for(n, n_digits=None):
- count = 0
- for c in str(n):
- if c in "02468":
- count += 1
- return count
- def count_even_digits_spyr03_sum(n, n_digits=None):
- return sum(c in "02468" for c in str(n))
- def count_even_digits_spyr03_list(n, n_digits=None):
- return [c in "02468" for c in str(n)].count(True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement