If you want to know how many values match in both the dictionaries, you should have said that 🙂
Maybe something like this:
shared_items = {k: x[k] for k in x if k in y and x[k] == y[k]}
print(len(shared_items))
If you want to know how many values match in both the dictionaries, you should have said that 🙂
Maybe something like this:
shared_items = {k: x[k] for k in x if k in y and x[k] == y[k]}
print(len(shared_items))