[Python] 合併兩個Dictionary
a={1:2}
b={2:3}
c = dict(a.items() + b.items())
# c = {1:2 2:3}
如果有重複鍵值(Key),則以後者為主
a={1:2, 2:4}
b={2:3}
c = dict(a.items() + b.items())
# c= {1:2, 2:3}
c = dict(b.items() + a.items())
# c= {1:2, 2:4}
a={1:2}
b={2:3}
c = dict(a.items() + b.items())
# c = {1:2 2:3}
如果有重複鍵值(Key),則以後者為主
a={1:2, 2:4}
b={2:3}
c = dict(a.items() + b.items())
# c= {1:2, 2:3}
c = dict(b.items() + a.items())
# c= {1:2, 2:4}