Python Tutorials · Python Dictionaries

Add Items

Learn all about Add Items in this comprehensive tutorial.

5 min read beginner
  • Adding an item to the dictionary is done by using a new index key and assigning a value to it:
  • The update() method will update the dictionary with the items from a given argument.

Adding Items

Adding an item to the dictionary is done by using a new index key and assigning a value to it:

python

Update Dictionary

The update() method will update the dictionary with the items from a given argument. If the item does not exist, the item will be added.

The argument must be a dictionary, or an iterable object with key:value pairs.

python

Module quiz

2 questions
1

Which of the following is true about Add Items?

2

What is the most common pitfall when working with Add Items?

Answer all questions to submit.