Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python Write a function named letter_counter that takes a string as a parameter and prints out the number of times each letter (upper- or

image text in transcribed

In python Write a function named letter_counter that takes a string as a parameter and prints out the number of times each letter (upper- or lower-case) appears in the string. The letters must be printed alphabetically and in lowercase. Your program should output this: >>> result - letter_counter ("brontasaurus") The letter a is in the string brontasaurus 2 time(s). The letter bis in the string brontasaurus 1 time(s). The letter n is in the string brontasaurus 1 time(s). The letter o is in the string brontasaurus 1 time(s). The letter r is in the string brontasaurus 2 time(s). The letter s is in the string brontasaurus 2 time(s). The letter t is in the string brontasaurus i time(s). The letter u is in the string brontasaurus 2 time(s). >>> print (result) {'b': 1, 'r': 2, 'o': 1, 'n': 1, 't': 1, 'a': 2, 's': 2, 'u': 2)

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

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions

Question

1. Who will you assemble on the team?

Answered: 1 week ago

Question

4. Who would lead the group?

Answered: 1 week ago