Question: Pls use python string methods to solve this question, thanks def count_common occurrences (wordl: str, word2: str) -> int: Given two strings, wordl and word2,

 Pls use python string methods to solve this question, thanks def

Pls use python string methods to solve this question, thanks

def count_common occurrences (wordl: str, word2: str) -> int: Given two strings, wordl and word2, return how many characters in wordl are characters that also occur in word2. You can assume any letters in the given string are lowercase. Also, spaces do NOT count as a common character. Algorithm: - Go through each character in wordl, one by one. If this character occurs in word2, then add 1 to the count. Return total count after you're done going through the characters. >>> count_common_occurrences('bob y', 'bobbette z') >>> count_common_occurrences ('bobbette z', 'bob y') pass

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 Databases Questions!