You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Understand what the interviewer is asking for by using test cases and questions about the problem.
When we call the function, what will that input parameter be used for?
It will be the dictionary the loop iterates over.
P-lan
Plan the solution with appropriate visualizations and pseudocode.
General Idea: Call the function with the input dictionary.
1) Extract the unique parts of each string (there will be two)
2) Create a dictionary with the first parts as the keys and the second as the values
3) Call the function with the dictionary as the input
I-mplement
defmatch_made(dictionary):
forkey, valueindictionary.items():
print( f"{key} and {value} are a perfect match.")
match_made({"Peanut butter": "Jelly", "Spongebob": "Patrick", "Ash": "Pikachu"})