Merge Two Dictionaries Python || Dictionaries || Python
In this we are going to see a basic program to merge two dictionaries in Python Programming Language.




dict1 = {1: 'a',2: 'b',3: 'c',4: 'd',5: 'e'}
dict2 = {6: 'f',7: 'g',8: 'h',9: 'i',10: 'j'}
dict = {}
for i in (dict1,dict2):
    dict.update(i)
print("Dictionary 1:",dict1)
print("-----------------------------------------------------")
print("Dictionary 2:",dict2)
print("-----------------------------------------------------")
print("Concatenated Dictionary:",dict)


#ENJOY CODING


Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post