Find Mismatched Words
You are given two sentences as strings
. Create a function that returns a list of all words that are not in both sentences.
You can assume that the sentences have no punctuation marks, extra tabs, or spaces.
Note: The strings "Game"
and "game"
should be considered the same word. Because of this, make sure all the strings in the list you output are in lowercase.
Example:
Input:
string1 = "I want to eat fish today with my friends"
string2 = "All I want is to eat fish today with my friends"
Output:
def mismatched_words(string1,string2) -> ["all","is"]
Next question: Restaurant Recommender.....
Loading editor