Question: Write function called listletters(text)that passes text as a string of letters and returns a dictionary with the key as the letter and the value as
Write function called listletters(text)that passes text as a string of letters and returns a dictionary with the key as the letter and the value as the number of times each letter appears in a given string.
Example: If the input string is 'BaNaNa', then the dictionary returned should be
{'B':1, 'a':3, 'N':2} Write function calledlistwords(text)that passes text as a string of letters that consists of words separated by blanks. The function returns a dictionary with the key as the unique words and the value as the number of times that word appears in the input string.
Example:
If the parameter string is 'Banana', then the dictionary returned should be:
{'Banana': 1} Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
