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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started