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

Tell us what’s happening:

I’m struggling with tuples for some odd reason. The message I get is:

Your dictionary should have 4 keys called A , B, C, and D.
my_graph[“A”] should be a list of tuples.
my_graph[“A”] should be a list of tuples where the first item in the tuple is the connected node and the second item is the distance.

As always, thank you for your help.

Your code so far


/* User Editable Region */

my_graph = {
    'A': [('B', 3), ('D', 1)]

/* User Editable Region */

    'B': ['A', 'C'],
    'C': ['B', 'D'],
    'D': ['A', 'C']
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) 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 15

you are missing the comma at the end of line, making it a syntax error and none of the tests pass

2 Likes

Doh! Of course! Thank you!

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.