curriculum/challenges/english/blocks/learn-algorithm-design-by-building-a-shortest-path-algorithm/65578cee7f2cb8b80127cce2.md
Before the print call, create a while loop that runs while unvisited is not empty. Use the pass keyword to fill the loop body.
You should have a while loop that executes while unvisited is not empty. Don't forget the pass keyword.
({ test: () => {
const commentless_code = __helpers.python.removeComments(code);
const {function_body} = __helpers.python.getDef(commentless_code, "shortest_path");
assert(function_body.match(/^\s+while\s+(unvisited|unvisited\s*!=\s*\[\s*\]|len\s*\(\s*unvisited\s*\)\s*(>|!=)\s*0)\s*:/m));
const {block_body} = __helpers.python.getBlock(commentless_code, /while\s+(unvisited|unvisited\s*!=\s*\[\s*\]|len\s*\(\s*unvisited\s*\)\s*(>|!=)\s*0)\s*/);
assert(block_body.match(/\s+pass/))
}
})
my_graph = {
'A': [('B', 3), ('D', 1)],
'B': [('A', 3), ('C', 4)],
'C': [('B', 4), ('D', 7)],
'D': [('A', 1), ('C', 7)]
}
--fcc-editable-region--
def shortest_path(graph, start):
unvisited = list(graph)
distances = {node: 0 if node == start else float('inf') for node in graph}
paths = {node: [] for node in graph}
paths[start].append(start)
print(f'Unvisited: {unvisited}\nDistances: {distances}\nPaths: {paths}')
#shortest_path(my_graph, 'A')
--fcc-editable-region--