Unit 2 Session 2 (Click for link to problem statements)
Understand what the interviewer is asking for by using test cases and questions about the problem.
Plan the solution with appropriate visualizations and pseudocode.
General Idea: Loop through one dict and make a list of any keys that are also in the other dict.
1) Create an empty list to hold common keys
2) For each key in dict1
a) If the key is also in dict2, add to common keys
3) Return common keys
def common_keys(dict1, dict2):
common = []
for key in dict1:
if key in dict2:
common.append(key)
return common
``