Avatar ·

Iterating over key-value pairs in 2 or more dictionaries and recording matches in a new dictionary using *args

📁 dictionary, Advanced Python Topics, Help, Error

There are two dictionaries, you need to iterate over key-value pairs in both dictionaries. Compare if the same key-value exists using a FOR loop and the *args parameter. Add the found matching key-value pairs to a new dictionary.

 operator_one = {2: 'break', 1: '`` `` `` `", 3: 'print', 4: 'yield', 5: 'try'} operator = {1: 'pass', 2: 'global', 3: '