How to get the difference between two dictionaries in Python?

I have two dictionaries. I need to find the difference between the two which should give me both key and value.

I have searched and found some addons/packages like datadiff, dictdiff-master but when I try it in Python 2.7 it says no such module defined.

I used set here.

    first_dict = {}
    second_dict = {}

    value = set(second_dict)-set(first_dict)
    print value

output >>>set(['SCD-3547', 'SCD-3456'])

I am getting only key, I need to even get the values.

Try the following snippet, using a dictionary comprehension:

    value = { k : second_dict[k] for k in set(second_dict) - set(first_dict) }

In the above code we find the difference of the keys and then rebuild a dict taking the corresponding values.

From: stackoverflow.com/q/32815640