Answered step by step
Verified Expert Solution
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
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
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