Merging dictionaries in Python

Coding with Python

🕑 This lesson will take about 5 minutes

In Python, you can merge two dictionaries using a simple expression. In the example below, we will have two separate dictionaries and then write an expression to merge them into one dictionary that is in the same order as listed in the expression. The two dictionaries (dictionary1 and dictionary2) will be merged into a new dictionary called new_dictionary.