Problem Solving
After you have worked out an algorithm for solving a problem, write a program that implements your algorithm. When finished, test your programs.
- Common Count
Two strings have a letter in common if it appears in both strings. The position of letter is not important for it to be counted as common. Once a particular letter is counted as in common, it cannot be counted again. For example, an o appearing twice in one word but only once in the other counts only as one letter in common. However, an o appearing twice both words counts as two letters in common.
- What Python operations will be useful for finding out it a letter is in a string?
- How can you avoid counting a letter more than once?
- Lists can be modified, but strings cannot — how can this fact help solve this problem?