Back to Freecodecamp

Step 5

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

latest596 B
Original Source

--description--

Now, modify your existing print() call to print the value of the age key.

--hints--

You should use copper['age'] to access the value of the age key.

js
({ test: () => assert.match(code, /copper\s*\[\s*("|')age\1\s*\]/) })

You should call print() passing copper['age'] as argument.

js
({ test: () => assert.match(code, /^print\(\s*copper\s*\[\s*("|')age\1\s*\]\s*\)/m) })

--seed--

--seed-contents--

py
--fcc-editable-region--
copper = {
    'species': 'guinea pig',
    'age': 2
}
print(copper['species'])
--fcc-editable-region--