Write Function Signature Countdigits Takes List Integers Lst Returns Dictionary Containing Q37106491

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:::

1e def count disits(mlist: 2 mv pythonProject/src/staticClasses7/CountDigit.py for digit in myList: if digit in myDict: 4 myD

def

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.