programming-examples/python/Dictionary/Python program to concatenate following dictionaries to create a new one.py

6 lines
135 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
dic1={1:10, 2:20}
dic2={3:30, 4:40}
dic3={5:50,6:60}
dic4 = {}
for d in (dic1, dic2, dic3): dic4.update(d)
print(dic4)