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