Back-To-School Deals - hours only!Up to 80% off on all courses and bundles.-Close
Recap
Counting with dictionaries
Grouping with dictionaries
Linking with dictionaries
14. The update() function
Summary

Instruction

Good job! The next function we will need in linking dictionaries is update(). Take a look:

prices = {'Volvo': 15000, 'Ford': 12000, 'Skoda': 14000}
new_prices = {'Volvo': 20000, 'Nissan': 15000 }

prices.update(new_prices)

You are given a dictionary with prices for various cars and a dictionary with some new prices. The function update() updates the prices dictionary with values from the new_prices dictionary. After the update the new price of Volvo is 20000. A new car make Nissan is added to prices, its price is 15000.

Exercise

You are given the dictionary with salaries for 2019. Use the salaries_update dictionary to update salaries for 2019. Print the modified salaries_2019 dictionary.

Note that the new employee Mary has been added to salaries_2019.