Problem

The letters a, b, d, e, g, o, p, and q all have something in common: a hole. If you imagin...

The letters a, b, d, e, g, o, p, and q all have something in common: a hole. If you imagine that the letters were made of stretchy material such as rubber, you could transform one letter into another while preserving the hole. If tearing or gluing are not allowed, no other letter (without a hole) could be transformed by stretching into one of these letters with holes. Mathemeticans say that these letters are topologically similar: one set has a hole, the rest do not.

(a) Write a function that takes as an argument a lowercase string and finds the counts of letters in the string with holes and the count of letters without holes.


(b) Write a function that searches a word list and prints all the words that have two or more letters with holes.


(c) The set of uppercase letters with holes is different than the set of lowercase letters, e.g., lowercase E belongs to the set of letters with a hole, but its capital E does not. Refactor your functions to consider uppercase letters.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT