Files
freeCodeCamp/curriculum/challenges/english/blocks/learn-algorithm-design-by-building-a-shortest-path-algorithm/6579ca0923cfa7162089d2f0.md
2025-08-26 12:37:26 +02:00

822 B

id, title, challengeType, dashedName
id title challengeType dashedName
6579ca0923cfa7162089d2f0 Step 8 20 step-8

--description--

The same syntax can be used to change the value of an existing key.

Just before the print() call, access the 'species' key and reassign its value to 'Cavia porcellus'.

--hints--

You should reassign the copper['species'] to the string 'Cavia porcellus' before the print() call.

({ test: () => {
    const commentless_code = __helpers.python.removeComments(code);
    assert.match(commentless_code, /^copper\s*\[\s*("|')species\1\s*\]\s*=\s*("|')Cavia porcellus\2\s+^print\s*\(\s*copper\s*\)/m)
  }
})

--seed--

--seed-contents--

--fcc-editable-region--
copper = {
    'species': 'guinea pig',
    'age': 2
}
copper['food'] = 'hay'

print(copper)
--fcc-editable-region--