. 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
. 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%
Step by Step Solution
3.46 Rating (149 Votes )
There are 3 Steps involved in it
Step: 1
1 def countuppermystring count 0 for char in mystring if charisupper count 1 return count Answ...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