I have an output from my loop, where G is a Graph from networkX.
for node in G.nodes(): start_end = [(node,k) for k,v in nx.shortest_path_length(G, node)