Question: PYTHON Define a function called analyze string.The function must define two formal quote-The quote to analyze. search letter - The letter to be counted in
PYTHON


Define a function called analyze string.The function must define two formal quote-The quote to analyze. search letter - The letter to be counted in the quote, regardless of case. The function will return a formatted string. The formatted string must contain the basic statistics about the occurance of search letter in the quote. The function must have docStrings to get full credit Process 1. Define the following local variables before the loop. These variables will be used to hold data as the loop executes. 1. the count letters of al alphabet characters in the quote and initialize it to 2. the count occurance of the search letter in the quote and initialize it to 3. all the letters in the alphabet and initialize it to each lowercase character from a to z. If you do not want to write out all the letters in the alphabet, you could alternatively search for the string class API. There maybe some contants out there you can refer to. We worked with constants in the math class: ex. math.pi) 2. Update quote so that all characters are transtormed to lowercase 3. Loop through each character in the quote. You can use either a while or for loop. 1. Count the alphabet charactors in your text. In other words, do not include punctuation, spaces, symbols, or numbers in the count. 2. Count the occurances of search letter in the quote
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
