Search for question
Question

Question #3 Write a Python user-defined function that accepts 2 strings of any length and displays a horizontal frequency graph comprised of asterisks (see below) of each ALPHABETIC letter in the

first string whose character is contained in the second string (the frequency graph must be displayed in alphabetical order i.e. from a to z in lowercase). Spaces and all non-alphabetic characters are to be ignored! The frequency table must be displayed as: c=x*x (where c is a letter of the alphabet, x is the number of that letter in the pool string, and *x is x number of asterisks, followed by a new line). The function prototype MUST be: def char_frequency (pool, atoms) For example, the function call: char_frequency ("Python is such a great language!", "ptaes") would display: a=4 **** e=2 ** p=1 * 8=2 ** t=1 * HINT: Consider using Python's upper(), lower(), and ord() functions and string.ascii_lowercase to complete your solution.

Fig: 1