def visit_and_print_all_nodes(graph):
    'Visits all the nodes in graph and prints graph.data after each move'
    nodes = graph.node_names
    for node in nodes:
        graph.move_to_node(node)
        print(graph.data)
Visits all the nodes in graph and prints graph.data after each move
def visit_and_print_all_nodes(graph):
    
    nodes = graph.node_names
    for node in nodes:
        graph.move_to_node(node)
        print(graph.data)