Back to Freecodecamp

Step 10

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

latest700 B
Original Source

--description--

If you want to iterate over the values of the dictionary keys, one way is to use the .values() method.

Modify your for loop to iterate over copper.values() instead of copper and look at the output.

--hints--

You should modify your for loop to iterate over copper.values() instead of copper.

js
({ test: () => assert(runPython(`_Node(_code).find_for_loops()[0].find_for_iter().is_equivalent("copper.values()")`)) })

--seed--

--seed-contents--

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

for i in copper:
    print(i)
--fcc-editable-region--