In this python dictionary program, we will concatenate two dictionaries to form a single dictionary.
Steps to solve the program
- Take two dictionaries as input.
- Concatenate two dictionaries using update().
- Print the output.
dict1 = {'name':'yash','city':'pune'}
dict2 = {'course':'python','institute':'sqatools'}
dict1.update(dict2)
print(dict1)
Output :
{'name': 'yash', 'city': 'pune', 'course': 'python', 'institute': 'sqatools'}