Question: Design a program named CharDistribution.py , within this program, implements functions as specified below: charFrequency ( aString , aChar ) - this function counts number

Design a program named CharDistribution.py, within this program, implements functions as specified below: charFrequency(aString, aChar)- this function counts number of times the char aChar appears in aString. For example, calling charFrequency("Hello hanson", 'h') should return 2, because char 'h' appears in the String twice. We donot make difference between upper and lower cases. allCharFrequency(aString)-(it is OK if you have already implemented : allCharFrequency(aString, aChar))- this function counts number of times of each of 26 alphabetic letters appears in aString and return the frequencies as a 26-element list. Again, we don't make differenec between lower and upper cases. printFrequency(fre), where fre is the frequency of 26 alphabetic letters. This function will print the frequency in the format as follows: A: [10] # lette a/A appears 10 times B: [2] # letter b/B appears 2 times ...

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 Programming Questions!