Back to Freecodecamp

Step 17

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

latest919 B
Original Source

--description--

Replace the 'age' key with the string 'B' and set its value to the string 'A' to represent the connection between the nodes in both directions.

--hints--

Your dictionary should have a 'B' key.

js
({ test: () => assert(runPython(`
    "B" in my_graph
  `))
})

Your 'B' key should have 'A' as the value.

js
({ test: () => assert(runPython(`
    my_graph["B"] == "A"
  `))
})

Your dictionary should have an 'A' key.

js
({ test: () => assert(runPython(`
    "A" in my_graph
  `))
})

Your 'A' key should have 'B' as the value.

js
({ test: () => assert(runPython(`
    my_graph["A"] == "B"
  `))
})

Your dictionary should have two keys.

js
({ test: () => assert(runPython(`
    len(my_graph) == 2
  `))
})

--seed--

--seed-contents--

py
--fcc-editable-region--
my_graph = {
    'A': 'B',
    'age': 2
}
--fcc-editable-region--