- 
                Notifications
    You must be signed in to change notification settings 
- Fork 266
Perfect Match
        Andrew Burke edited this page Aug 15, 2025 
        ·
        3 revisions
      
    Unit 3 Session 1 (Click for link to problem statements)
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.
 
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 inputdef match_made(dictionary):
    for key, value in dictionary.items():
        print( f"{key} and {value} are a perfect match.")
match_made({"Peanut butter": "Jelly", "Spongebob": "Patrick", "Ash": "Pikachu"})