Assuming,
dict1 = { "A" : ["a","b","c"]} # old one
dict2 = { "A" : ["a","b","c","d"]} # new one
#i wanna get
dict3 = {"A":["d"]}
as i know, taking up 'deepdiif' isn't right because it has to have same architecture of Dictionary how can i get that diffrence of added datas of Dictionary in simple and easy way?
You can do this with
set.symmetric_difference():If you have more dictionary keys than just one (but both have the same key set):
EDIT: if you don't know a priori that the two dictionaries have the same key set, you can make this a little bit more robust by treating it as a "differentiated union" where keys in the intersection of the two key sets are diff'd, and keys not in the intersection are treated as a normal
dict.union:Output: