How to Think Like a Computer Scientist: Learning with Python 3 Chapter 7 Exercises Question 15. 15. Write a function num
Posted: Sun Jul 03, 2022 11:22 am
How to Think Like a Computer Scientist: Learning with Python3
Chapter 7 Exercises
Question 15.
15. Write a function num_even_digits(n) that counts the numberof even digits in n. These tests should pass:
test(num_even_digits(123456) == 3)
test(num_even_digits(2468) == 4)
test(num_even_digits(1357) == 0)
test(num_even_digits(0) == 1)
Chapter 7 Exercises
Question 15.
15. Write a function num_even_digits(n) that counts the numberof even digits in n. These tests should pass:
test(num_even_digits(123456) == 3)
test(num_even_digits(2468) == 4)
test(num_even_digits(1357) == 0)
test(num_even_digits(0) == 1)