Back to Freecodecamp

Step 16

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

latest897 B
Original Source

--description--

For example, a graph can be used to represent two points in the space, A and B, connected by a path. A graph like this will be made of two nodes connected by an edge.

Replace the existent 'species' key with the strings 'A'. Then, replace the correspondent value with the string 'B' to represent the connection between the 'A' and 'B' nodes.

--hints--

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 = {
    'species': 'guinea pig',
    'age': 2
}
--fcc-editable-region--