course content

Course Content

Python Data Structures

Adding ItemsAdding Items

Let's build a dictionary named student.

Here's how you can add a key-value pair to a dictionary.

The student dictionary includes these pairs:

KeyValue
'first name''Ann'
'last name''Elliott'
'city''New York'
'country''USA'

Task

  1. Construct the following dictionary: 'name': 'Max', 'position': 'data scientist', 'level': 'junior'.
  2. To the existing dictionary, append a new key named experience (as a string) with the value of 1.

Everything was clear?

Section 2. Chapter 5
toggle bottom row