Question: Complete the code in the function that, given a list L of positive integers and a digit d , counts the number of occurrences of

Complete the code in the function that, given a list L of positive integers and a digit d, counts the number of occurrences of d in the numbers of the list L.

Here are some execution examples:

>>> count_of_given_digit_in_numbers_in_list([3, 3333, 33], 3)

7

>>> count_of_given_digit_in_numbers_in_list([13, 14, 258], 9)

0

>>> count_of_given_digit_in_numbers_in_list([1, 21, 30, 1411], 1)

5

>>> count_of_given_digit_in_numbers_in_list([4082, 5395, 7888, 5697], 0)

1

>>> count_of_given_digit_in_numbers_in_list([4082, 5395, 7888, 5697], 1)

0

>>> count_of_given_digit_in_numbers_in_list([4082, 5395, 7888, 5697], 7)

2

>>> count_of_given_digit_in_numbers_in_list([4082, 5395, 7888, 5697], 8)

4

fill the Python Code:

def count_of_given_digit_in_numbers_in_list(L, d):

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!