I have two dictionaries.
a = {"ab":3, "bd":4}
b = {"cd":3, "ed":5}`
I want to combine them to {'bd': 4, 'ab': 3, 'ed': 5, 'cd': 3}
.
As this says, a.update(b)
can complete it. But when I try, I get:
type(a.update(b)) #--> type 'NoneType'
Would anyone like to explain it to me why I cannot gain a dict type?
I also tried this, and it did well:
type(dict(a,**b)) #-->type 'dict'
What is the difference between these two methods and why did the first one not work?