Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions