mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-30 16:01:14 -04:00
1.5 KiB
1.5 KiB
id, title, challengeType, dashedName
| id | title | challengeType | dashedName |
|---|---|---|---|
| 65661b72d6745ebec6a96923 | Step 17 | 20 | step-17 |
--description--
In the same way, modify the remaining two lists considering that the C-D distance is 7.
--hints--
my_graph["C"] should be a list of tuples.
({ test: () => assert(__pyodide.runPython(`
graph = __locals.get("my_graph")
type(graph["C"]) is list and all(type(i) is tuple for i in graph["C"])
`))
})
my_graph["C"] should be a list of tuples where the first item in the tuple is the connected node and the second item is the distance.
({ test: () => assert(__pyodide.runPython(`
graph = __locals.get("my_graph")
tuples = [("B", 4), ("D", 7)]
len(graph["C"]) == 2 and all(t in graph["C"] for t in tuples)
`))
})
my_graph["D"] should be a list of tuples.
({ test: () => assert(__pyodide.runPython(`
graph = __locals.get("my_graph")
type(graph["D"]) is list and all(type(i) is tuple for i in graph["D"])
`))
})
my_graph["D"] should be a list of tuples where the first item in the tuple is the connected node and the second item is the distance.
({ test: () => assert(__pyodide.runPython(`
graph = __locals.get("my_graph")
tuples = [("A", 1), ("C", 7)]
len(graph["D"]) == 2 and all(t in graph["D"] for t in tuples)
`))
})
--seed--
--seed-contents--
--fcc-editable-region--
my_graph = {
'A': [('B', 3), ('D', 1)],
'B': [('A', 3), ('C', 4)],
'C': ['B', 'D'],
'D': ['A', 'C']
}
--fcc-editable-region--