Question: def count_common_occurrences(word1: str, word2: str) -> int: Return how many alphabetical characters in word1 also occur in word2, case insensitive (that is 'A' and
def count_common_occurrences(word1: str, word2: str) -> int: """ Return how many alphabetical characters in word1 also occur in word2, case insensitive (that is 'A' and 'a' should count as common). Spaces and punctuation do NOT count as a common character.
In this example, the B O and B all appear in lowercase form in the second argument. Notice that we count both B's in the first argument: >>> count_common_occurrences('BOB Y', 'bobbette z') 3
Here, b, o, b, and b appear in uppercase form in the second argument. We count all 3 occurrences of the letter b in the first argument: >>> count_common_occurrences('bobbette z', 'BOB Y') 4 """
# TODO: design and write the function body
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
