Back to Freecodecamp

Step 2

curriculum/challenges/english/blocks/learn-algorithm-design-by-building-a-shortest-path-algorithm/65576ff7888f9e96f52a4be1.md

latest867 B
Original Source

--description--

Dictionaries store data in the form of key-value pairs. A key is separated from the correspondent value by a colon. And each key-value pair is separated from the following pair by a comma:

py
my_dict = {
    'name': 'Michael',
    'occupation': 'Lumberjack'
}

Add a new key-value pair to your dictionary. Use the string 'species' as the key, and the string 'guinea pig' as the value.

--hints--

You should have a 'species' key with the value 'guinea pig' inside your copper dictionary.

js
({ test: () => assert(runPython(`
    copper == {"species": "guinea pig"}
  `))
})

Your copper dictionary should have a single key-value pair.

js
({ test: () => assert(runPython(`
    len(copper) == 1
  `))
})

--seed--

--seed-contents--

py
--fcc-editable-region--
copper = {}
--fcc-editable-region--