Question: import math import random import string import collections import datetime import re import time import copy def drawPascalsTriangle(n) : your code here... # end def

import math import random import string import collections import datetime import re import time import copy  def drawPascalsTriangle(n) : your code here... # end def def alphaFrequency(userString) : your code here... # end def def encryptStr(userString, n) : your code here... # end def  def main( ) : myStr = """ You're an interesting species, an interesting mix. You're capable of such beautiful dreams and such horrible nightmares. You feel so lost, so cut off, so alone, only you're not. See, in all our searching, the only thing we've found that makes the emptiness bearable is each other. Contact --1997--""" for i in range(1, 20, 4) : drawPascalsTriangle(i) alphaFrequency(myStr) for i in list([2, 10, 25, 26, 1000, 13]) : encryptStr(myStr, i) # end main( ) if __name__ == "__main__" : main( )

Question #2 Write a Python user-defined function that accepts a string of any length and first displays the string followed by a horizontal frequency graph of all ALPHABETIC letters only in the string (in alphabetical order). Case of letters, spaces, and all non-alphabetic characters are to be ignored! The function prototype MUST be: def alphaFrequency(userString) For example, the function call: alphaFrequency("This is a Python test 123!") would display: This is a Python test 123! a=1 * e=1 * h=2 ** i=2 ** n=1 * o=1 * p=1 * s=3 *** t=4 **** y=1 * HINT: Consider using Python's upper( ), lower( ), and ord( ) functions and string.ascii_lowercase and string.ascii_uppercase to complete your solution.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!