Write the following python program. a. Assign a sentence of at least 15 characters into a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write the following python program. a. Assign a sentence of at least 15 characters into a string constant b. Perform analysis that counts the number of each letter and saves the result into a dictionary • Count letters ignoring case. So 'a' and 'A' are both counted as "A" • The letters are the keys, and the counts are the values Find the letter(s) that appears most frequently by evaluating the dictionary counts c. Write print statements with appropriate descriptions for the items calculated in step "b'. • Format print using the following examples. • The printed dictionary must be sorted alphabetically Need to handle the cases of one most frequent letter vs. multiple letters. Example Output #1 The string being analyzed is: "WAS IT A RAT I SAW?" 1. Dictionary of letter counts: ('A': 4, 'I': 2, 'R': 1, 'S': 2, 'T': 2, 'W': 2) 2. Most frequent letter "A" appears 4 times. Example Output #2 The string being analyzed is: "Wwwas it a rat I saw?" 1. Dictionary of letter counts: ('A': 4, '1': 2, 'R': 1, 'S': 2, "T': 2, 'W': 4) 2. Most frequent letters ['A', 'W'] appear 4 times. Write the following python program. a. Assign a sentence of at least 15 characters into a string constant b. Perform analysis that counts the number of each letter and saves the result into a dictionary • Count letters ignoring case. So 'a' and 'A' are both counted as "A" • The letters are the keys, and the counts are the values Find the letter(s) that appears most frequently by evaluating the dictionary counts c. Write print statements with appropriate descriptions for the items calculated in step "b'. • Format print using the following examples. • The printed dictionary must be sorted alphabetically Need to handle the cases of one most frequent letter vs. multiple letters. Example Output #1 The string being analyzed is: "WAS IT A RAT I SAW?" 1. Dictionary of letter counts: ('A': 4, 'I': 2, 'R': 1, 'S': 2, 'T': 2, 'W': 2) 2. Most frequent letter "A" appears 4 times. Example Output #2 The string being analyzed is: "Wwwas it a rat I saw?" 1. Dictionary of letter counts: ('A': 4, '1': 2, 'R': 1, 'S': 2, "T': 2, 'W': 4) 2. Most frequent letters ['A', 'W'] appear 4 times.
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Calculate the half life potential for Zn electrode is 0.01M Zn(NO 3 ) 2. Given that Zn 2+ + 2e= Zn E o = 0.763
-
Ellsworth Enterprises borrowed $425,000 on an 8%, interest-bearing note on September 30, 2020. Ellsworth ends its fiscal year on December 31. The note was paid with interest on March 31, 2021....
-
UA Hamburger Hamlet (UAHH) places a daily order for its high- volume items (hamburger patties, buns, milk, and so on). UAHH counts its current inventory on hand once per day and phones in its order...
-
Table B. 25 contains the golf data on strokes gained. Use all possible regressions to build a model for these data. Perform a residual analysis on the final model and comment on model adequacy. SG:...
-
On December 31, 2014, when the market interest rate is 6%, OBrien Realty issues $ 800,000 of 7.25%, 10-year bonds payable. The bonds pay interest semiannually. OBrien Realty received $ 874,662 in...
-
2 Is it possible to factor 1 - sin x two different ways? If so, show and explain. If not, why not?
-
The unadjusted trial balance of Mesa Inc., at the company's year end of December 31 follows: Additional information and adjustment data: 1. The 12-month insurance policy was purchased and was...
-
4. Which motivation theory have you found to be most useful in explaining why people behave in a certain way? Why?
-
The ACME Computer Co. operates three plants that manufacture notebook computers. The plants are located in Seattle, Singapore, and New York. The plants produce 20, 30, and 50 percent of the company's...
-
A company manages three different mutual funds. Let \(A_{\mathrm{i}}\) be the event that the ith mutual fund increases in value on a given day. Probabilities of various events relating to the mutual...
-
A large-scale firm specializing in providing temporary secretarial services to corporate clients has completed a study of the main reason why secretaries become dissatisfied with their work...
-
SUPERCOMP, a retail computer store, sells personal computers and printers. The number of computers and printers sold on any given day varies, with the probabilities of the various possible sales...
-
Consider the experiment of tossing a fair coin (meaning heads and tails are equally likely on each toss) three times and observing the sequence of heads and tails that results. Let \(H\) denote heads...
-
Coal Town ltd are a small book publishing firm based in Salford. The company is considering launching a new imprint - Ghost Town specialising in ghost and horror stories. The outcome of the project...
-
Use critical values to test the null hypothesis H0: 1 2 = 20 versus the alternative hypothesis H0: 1 2 20 by setting a equal to .10, .05, .01, and .001. How much evidence is there that the...
-
Linda and Richard are married and file a joint return for 2012. During the year, Linda, who works as an accountant for a national airline, used $2,100 worth of free passes for travel on the airline;...
-
Dr. George E. Beeper is a single taxpayer. He lives at 45 Mountain View Dr., Apt. 321, Spokane, WA 99210. Dr. Beeper's Social Security number is 775-88-9531. Dr. Beeper works for the Pine Medical...
-
For each of the following cases, indicate the filing status for the taxpayer(s) for 2012 using the following legend: A - Single B - Married, filing a joint return C - Married, filing separate returns...
-
What is the ratio T f /T i for this process? A. 1/4 B. 1/2 C. 1 (no change) D. 2 E. 4 F. There is not enough information to decide. p (atm) 4 3- 2 1 0- 0 2 -V (m)
-
Jn Figure 12.22, by comparing the slope of the graph during the time the liquid water is warming to the slope as steam is warming, we can say that A. The specific heat of water is larger than that of...
-
An aluminum ring is tight around a solid iron rod. If we wish to loosen the ring to remove it from the rod, we should A. Increase the temperature of the ring and rod. B. Decrease the temperature of...
Study smarter with the SolutionInn App