Question: modify my docstring! and change the function name to find _ letters ( ) convert it into a function that takes a string for an

modify my docstring! and change the function name to find_letters()
convert it into a function that takes a string for an argument called words
counts the number of occurrences of the letters using a dictionary data structure(!)
For instance (your output look different, but the values should be the same):
michael would return {'i':1,'e':1,'a':1}
miguelito would return {'i':2,'e':1,'u':1,'o':1}
Printing the dictionary will be the responsibility of the caller. (But when you are building it, you can add print statements to verify your code. Good debugging technique.)
You make your program "case insensitive"
This means Angel should return {'a':1,'e':1}, not {'e':1}
using annotations: modify the argument list to default to vowels 'aeiou', but can be changed by the caller. add the return type (-> set).
i.e., def find_letters(words:str, letters:str='aeiou')-> set
which can have the following example calls
find_letters( 'galaxy' )
find_letters( 'galaxy', 'wxyz')
find_letters(letters='abcd', words='Abba Rocks Big Time')
Answer the question: Why did I use the list version, rather than the set version?
Suggested test strings (you will have to come up with others)--> miguelito, Arturo, Angelica, Chrys, Senorita Bullfrog

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!