Write a Python program that will take a string consisting of only A, B and C's...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Python program that will take a string consisting of only A, B and C's uppercase and lowercase mixed sequence from the user. Your progra should generate a dictionary having "A", "B", "C" as the keys and the frequency of "uppercase of key" in the string as the first indexed value, the frequency of "lowercase of key" in the string as the second indexed value and the summation of both the frequency as the third indexed value a list as the values. Last of all, your program should check if there are any pairs that are the best match, by comparing the total frequency. Sample Input 1 AaBbbbCcCc Sample Output 1 { "A": [1, 1, 2] "B": [1, 3, 4] "C": [2, 2, 4] } B and C are the best match. Write a Python program that will take a string consisting of only A, B and C's uppercase and lowercase mixed sequence from the user. Your progra should generate a dictionary having "A", "B", "C" as the keys and the frequency of "uppercase of key" in the string as the first indexed value, the frequency of "lowercase of key" in the string as the second indexed value and the summation of both the frequency as the third indexed value a list as the values. Last of all, your program should check if there are any pairs that are the best match, by comparing the total frequency. Sample Input 1 AaBbbbCcCc Sample Output 1 { "A": [1, 1, 2] "B": [1, 3, 4] "C": [2, 2, 4] } B and C are the best match.
Expert Answer:
Answer rating: 100% (QA)
Heres a Python program that takes a string as input generates a dictionary as specified and checks f... View the full answer
Related Book For
Numerical Methods With Chemical Engineering Applications
ISBN: 9781107135116
1st Edition
Authors: Kevin D. Dorfman, Prodromos Daoutidis
Posted Date:
Students also viewed these programming questions
-
Lynn's Music School created a $250 petty cash fund on August 1. During the month, the fund custodian authorized and signed petty cash tickets as follows: Requirements 1. Record the journal entry to...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Use implicit differentiation to find dy/dx. 6x 3 + 7y 3 = 13xy
-
How can break-even analysis help an entrepreneur planning to launch a business? What information does it give an entrepreneur?
-
In Exercises, find the indefinite integral and check the result by differentiation. EX xp (1 + x)
-
Explain the assumptions of working of the reciprocating compressor. Discuss the working of a reciprocating compressor with a neat sketch.
-
On June 30, Techcram Management Company purchased land for $350,000 and a building for $450,000, paying $400,000 cash and issuing a 6% note for the balance, secured by a mortgage on the property. The...
-
What is the profit under the "best case scenario? According to the scenario manager (output), what is the profit under the "most likely" scenario? According to the one variable DATA TABLE, what is...
-
The proposed rates were not in the range the CEO expected given the pricing analysis. The CEO has asked the pricing actuary to verify the total projected loss cost excluding potential large storm...
-
Be sure to answer all parts A gas expands in volume from 31.8 mL to 96.3 mL at constant temperature. (a) Calculate the work done (in joules) if the gas expands against a vacuum: Enter your answer in...
-
In the figure below, a graph of the position of a vesicle that was observed to move along a straight line. At what instant of time is the magnitude of the vesicle's acceleration the largest? t=0s...
-
The graph below plots velocity vs. time for an object moving along a straight path. v (m/s) 24 18 12- 6 0 -6 -12 -18- -24 (i) 0s to 7.00 s (iii) 0s to 28.0 s (ii) 7.00 s to 21.0 s 7 (a) What is the...
-
In the system shown in the figure, assume that the surfaces are frictionless, if M = 4.5 kg, calculate the mechanical energy of the mass 2M before the system starts moving, in J? 2m M 2.M 0.4m
-
Of the following characteristics and behaviors, which one is most associated with resilience?
-
What does resilience mean? Explain the term in individual , community , national and global levels.
-
The number of miles that a particular car can run before its battery wears out is exponentially distributed with an average of 10,000 miles. The owner of the car needs to take a 5000-mile trip. What...
-
Solve each equation. x 3 - 6x 2 = -8x
-
Use LU decomposition to compute the inverse of 2 -2 4 4 1 14 3 1
-
Write the system of first-order equations we need to solve subject to dy dy dx3 dx + = 0 (4.7.16)
-
Write a MATLAB program that uses finite difference to solve on x [0, 1] subject to y(0) = 1 and y(1) = 0 and on x [0, 1] subject to y(0) = 1 and y(1) = 0. Use the solution to the linear problem, y...
-
Two loudspeakers in a \(20^{\circ} \mathrm{C}\) room emit \(686 \mathrm{~Hz}\) sound waves along the \(x\)-axis. What is the smallest distance between the speakers for which the interference of the...
-
In noisy factory environments, it's possible to use a loudspeaker to cancel persistent low-frequency machine noise at the position of one worker. The details of practical systems are complex, but we...
-
When you voice the vowel sound in "hat," you narrow the opening where your throat opens into the cavity of your mouth so that your vocal tract appears as two connected tubes. The first is in your...
Study smarter with the SolutionInn App