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

Tell us what’s happening:

Your dictionary should have 3 keys — A , B , and C .

Your code so far


/* User Editable Region */

my_graph = {
    'A': 'B',
    'B': 'A',
    'C': my_graph['B']
}

/* 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 13

Add another node connected to B to your graph and call it C.

C should connect to B just like A connects to B.

Use a list to represent the multiple connections of your B node.

B should have a list of the nodes it’s connected to (A and C)

2 Likes

Updated code: my_graph = {
‘A’: ‘B’,
‘B’: [‘A’, ‘C’],
‘C’: 'B
}
And yet the error is still Your dictionary should have 3 keys — A , B , and C .

1 Like

Double check all your punctuation, quotes and commas and curly braces and everything

3 Likes

Got it! Thank you so much!