. Write a function called count_upper that returns the number of uppercase characters that appear in...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
. Write a function called count_upper that returns the number of uppercase characters that appear in the input parameter "my_string". Write a print_percentage that takes a string as its parameter and prints the percentage of uppercase letters in that string. Make sure you use the count_upper function to calculate the uppercase percentage. Use the following formula to find the uppercase percentage: uppercase rate = number of uppercase letters / total number of characters (uppercase percentage is the uppercase rate printed in percentage format) Find the percentage of the uppercase characters in the following strings: "Hello, My Name is ABC." "#012%6jjx: This is NOT GOOD" The output should be as follows: Percentage of uppercase letters in "Hello, My Name is ABC." is: 27.27% Percentage of uppercase letters in "#012%6jjx: This is NOT GOOD" is: 33.33% . Write a function called count_upper that returns the number of uppercase characters that appear in the input parameter "my_string". Write a print_percentage that takes a string as its parameter and prints the percentage of uppercase letters in that string. Make sure you use the count_upper function to calculate the uppercase percentage. Use the following formula to find the uppercase percentage: uppercase rate = number of uppercase letters / total number of characters (uppercase percentage is the uppercase rate printed in percentage format) Find the percentage of the uppercase characters in the following strings: "Hello, My Name is ABC." "#012%6jjx: This is NOT GOOD" The output should be as follows: Percentage of uppercase letters in "Hello, My Name is ABC." is: 27.27% Percentage of uppercase letters in "#012%6jjx: This is NOT GOOD" is: 33.33%
Expert Answer:
Answer rating: 100% (QA)
1 def countuppermystring count 0 for char in mystring if charisupper count 1 return count Answ... View the full answer
Related Book For
Posted Date:
Students also viewed these general management questions
-
Booles Rule for numerical integration on the interval [a,b] is given by (a) Show that the degree of precision of this formula is 5. (b) Develop the Composite Booles Rule for integration on [a,b]....
-
The angle of the pendulum of Figure b is given by = m cos [(4.44 rad/s)t + ]. If at t = 0, 9 = 0.040rad and d/dt = 0.200 rad/s, what are (a) The phase constant and (b) The maximum angle m ?
-
Show that (Use integration by parts.) Express this formula as a probabilistic relationship between Poisson and gamma random variables. zys =1,2, 3, . . . . ,
-
Consider the Cobb-Douglas production function f(x, y) = 300x0.85, 0.15 When x = 4000 and y = 800, find the following. (Round your answers to two decimal places.) (a) the marginal productivity of...
-
Assume that S = $45, K = $40, r = 0.05, = 0.02, and = 0.30. Using the up rebate formula (equation (23.21)), find the value of H that maximizes (H K) UR(S, , r, T, ), for T = 1, 10, 100, 1000, and...
-
At the beginning of 2020, Aristotle Company acquired a mine for $970,000. Of this amount, $100,000 was ascribed to the land value and the remaining portion to the minerals in the mine. Surveys...
-
When $300, plus sales tax of 6%, is received for an amount previously owed, Cash is debited for what amount? (a) $18 (c) $300 (b) $318 (d) $282
-
Fresh Choice, a cooperative of organic family-owned farms outside of Madison, Wisconsin, has recently started a fresh produce club to provide support to the groups member farms and to promote the...
-
Assume that we have the following data: C=100+0.50Y I p =100-20r M t =0.10Y M s =100-10r M=80 a. Build the IS-LM function. b. If we assume an increase in Investments by 100 units, please calculate...
-
Banko Inc. manufactures sporting goods. The following information applies to a machine purchased on January 1, Year 1: $ 78,500 $ 2,000 $ 1,000 5 years 159,000 $ 2,000 Purchase price Delivery cost...
-
What do you think is the financial impact of the Israel-Gaza (Hamas) war on the World economy and financial markets? Do you think it will impact us in the USA as well?
-
Gilbertsons Maple Products http://www.gilbertsonsmaple.com/ of St. Josephs Island Ontariois looking to distribute their line of Maple Syrup Products to specialty food stores in Europe. This is a new...
-
Duran Company produces asphalt roofing materials. The production budget in bundles for Duran's most popular weight of asphalt shingle is shown for the following months: March Units 9,000 April 13,000...
-
Evaluate the contour integral f z'dz where CC: 2-3. (z+5)(z-2i)' using the Cauchy's integral formula.
-
What four measures (not SV, CV, SPI, or CPI)form the basisfor all earned value performance assessments and forecasts? How is each defined? How is each used? QUESTION 2 How does Planned Value (PV)...
-
If you save 8 hundred dollars per month in a bank account that earns a 8% interest rate (compounded monthly) for 30 years, how much will be in your account in 30 years time? (Please use at least 5...
-
Suppose on January 1 Andrew's Tavern prepaid rent of $16,800 for the full year. At November 30, how much rent expense should be recorded for the period January 1 through November 30? At November 30,...
-
Imagine that your best friend knows you are taking a psychology course and wonders what psychology is all about. How would you define psychology for your friend? Write an essay on the discipline of...
-
Another way in which underlying assumptions can be violated is if there is correlation in the sampling, which can seriously affect the properties of the sample mean. Suppose we introduce correlation...
-
Let X have the pdf (a) Find the pdf of Y = X2 (b) Find EY and Var Y. 2
-
Binomial data gathered from more than one population are often presented in a contingency table. For the case of two populations, the table might look like this: where Population 1 is binomial(n1,...
-
Consider two companies with subsidiaries in Venezuela, a country that has been identified as hyperinflationary. U.S. Marts reporting currency is the U.S. dollar, and it uses U.S. GAAP to consolidate...
-
Question: Troy owns an art gallery specializing in Greek artifacts. To modernize the gallery, Troy borrows $150,000 from the Sparta Bank, which takes a security interest in all of his inventory....
-
Question: Lawrence Williams and his wife, Diana, enjoyed a luxurious lifestyle while his investment bank flourished. But when the bank failed, Lawrence was faced with debts of $6 million. On the eve...
Study smarter with the SolutionInn App