Learn Algorithm Design by Building a Shortest Path Algorithm - Step 6

Tell us what’s happening:

Not sure if I’m misinterpreting the instructions/feedback.

Instructions: Delete your print() call. Then, after declaring copper , add the key food to your dictionary and set its value to hay .

Feedback: You should add the key food to copper after declaring the dictionary.

I believe that’s what I did. Thoughts?

Your code so far


/* User Editable Region */

copper = {
    'species': 'guinea pig',
    'age': 2,
    'food': 'hay'
}

/* User Editable Region */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Challenge Information:

Learn Algorithm Design by Building a Shortest Path Algorithm - Step 6

You’ve put ‘food’ into the dictionary declaration. I think it wants you to do this outside the curly braces, using a similar method that you used to print age

1 Like

Or, as in the example:

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

my_dict['country'] = 'Canada'
1 Like

The example was helpful! Thanks a bunch!

1 Like

No problem, it was straight from the lesson :+1: