. 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...
-
The length of time spent waiting in line at a certain bank is modeled by an exponential density function with mean 8 minutes. (a) What is the probability that a customer is served in the first 3...
-
J. Q. Higgins, owner of Robins Nest, wants to determine the cost behavior of labor and overhead. Higgins pays his workers a salary; during busy times, everyone works to get the orders out. Temps...
-
Adjusting the accounts is the process of a. recording transactions as they occur during the period. b. updating the accounts at the end of the period. C. zeroing out account balances to prepare for...
-
Carolinas Golf School, Inc., completed the following transactions during October, 2012: Oct 1 Prepaid insurance for October through December, $900. 4 Performed services (gave golf lessons) on...
-
Sanchez Corporation runs two convenience stores, one in Connecticut and one in Rhode Island. Operating income for each store in 2020 is as follows: (Click to view the operating income for the...
-
Beacons Company maintains and repairs warning lights, such as those found on radio towers and lighthouses. Beacons Company prepared the following end-of-period spreadsheet at December 31, 20Y5, the...
-
Members of your design team have been working with the local hospital to develop a data model for their need to store information about patients, the patient's room number, the patient's doctor, drug...
-
Your friend Amber has approached you seeking advice concerning two investment opportunities that she is presently considering. Her classmate Simone has asked her for a loan of $ 6 5 0 to help...
-
Write the following expression as a product of trigonometric functions. sin 18 - sin 6
-
4. How can the business use liquidity ratios, such as the current ratio, quick ratio, cash ratio, and working capital, as well as solvency ratios, like the debt-to-equity ratio, interest coverage...
-
Firm A has a margin of 1 0 % , sales of $ 5 1 0 , 0 0 0 , and ROI of 1 9 % . Calculate the firm's average total assets. Firm B has net income of $ 7 4 , 0 0 0 , asset turnover of 1 . 5 0 , and...
-
What generally happens to men and women's income and assets after divorce?
-
Direct materials Direct labor $ 69,000 $ 35,000 Variable manufacturing overhead $ 15,000 Fixed manufacturing overhead 28,000 Total manufacturing overhead $ 43,000 Variable selling expense $ 12,000...
-
It is possible to investigate the thermo chemical properties of hydrocarbons with molecular modeling methods. (a) Use electronic structure software to predict cHo values for the alkanes methane...
-
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,...
-
What is the purpose of tests of controls?
-
Why are some tests of controls performed during the interim period?
-
What four factors should the auditor consider in deciding what evidence, if any, needs to be obtained during the period from the interim date to the balance sheet date?
Study smarter with the SolutionInn App