Question: Question # 5 : frequency ( txt ) 5 pts Returns a dictionary with the frequency count of each alphabet letter ( in lowercase )
Question #: frequencytxt pts
Returns a dictionary with the frequency count of each alphabet letter in lowercase in txt You
cannot make assumptions about the contents in txt
Preconditions and Postconditions
txt: nonempty str
Returns: dict frequency count
Useful methods:
The strisalpha method returns True if all characters in the string are alphabetic and there
is at least one character, False otherwise.
o sisalpha returns True
o isalpha returns False
The strlower method returns a copy of the string with all the cased characters converted
to lowercase.
o Alower returns a
ord returns an integer representing the Unicode code point of that character.
o orda returns
You are NOT allowed to use the count method or any other Python count libraries such as
Counter, mode, the min and max methods. You will not get credit if you used them in your
code, even if your code passed the test cases.
Example:
frequencymama
m: a:
answer frequencyWe ARE Penn State!!!
answer
w: e: a: r: p: n: s: t:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
