Write a function with the signature count_digits that takes alist of integers, lst, and returns a dictionary containing thetotal number of times that each digit between 0 and 9 appears inlst. def count_digits ( lst ): “”” sig : list ( int ) -> dict (str , int ) “”” For example, a call to count_digits([1,2,3]) willreturn the following dictionary: {1: 1 , 2: 1 , 3: 1} A call tocount_digits([2,0,1,9,0,4,1,9]) will return the dictionary: {2: 1 ,0: 2 , 1: 2 , 9: 2 , 4: 1}
Solution
Please find the code below:::
def
OR
OR