How to add new keys to a dictionary in Python?

Posted by Ramesh Singh | Updated on

Python dictionary provides a member function update() function. Let’s use this to add new key value pairs in dictionary or updating existing one. Below is an example to add new keys to a dictionary in Python.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers