Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function countChar(text) that given a string text, the function returns a dictionary of characters and their counts used in text. You need

Write a function countChar(text) that given a string text, the function returns a dictionary of characters

Write a function countChar(text) that given a string text, the function returns a dictionary of characters and their counts used in text. You need to count only characters 'a' to 'z', all upper characters should be treated as lower characters ('A' should be counted as 'a'). For example for the function call: countChar('Hello World'). returns: {'h': 1, 'e': 1, '1': 3, 'o': 2, 'w': 1, 'r': 1, 'd': 1} 1 def countChar (text): 2 495AWN 3 Save & Run 7 # write your code here Load History 5 # testing 6 print (countChar('Hello World')) Show CodeLens

Step by Step Solution

3.56 Rating (156 Votes )

There are 3 Steps involved in it

Step: 1

It appears youd like to write a Python function countChar that takes a string as input and returns a ... 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_2

Step: 3

blur-text-image_3

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

C++ Primer Plus

Authors: Stephen Prata

6th Edition

978-0321776402, 0321776402

More Books

Students also viewed these Programming questions

Question

=+ What are these leaders talking about?

Answered: 1 week ago

Question

What does the following preprocessor directive do? #include

Answered: 1 week ago