import networkx as nx
G = nx.Graph()
G.add_edges_from([(3, 4), (4, 5)], color="red")
G.add_edges_from([(1, 2), (6, 5)], color="red")
-sharpprint(G.edges)
graphs = list(nx.connected_component_subgraphs(G))
print(graphs)-sharp [<networkx.classes.graph.Graph object at 0x000000001160CF98>, <networkx.classes.graph.Graph object at 0x000000001160C940>]
print(type(graphs)) -sharp list
print(graphs[1]) -sharp
print(graphs[1].nodes) -sharp[3, 4, 5, 6]
now the question is why
print (graphs [1])-sharp returns nothing
print (graphs [1] .returns)-sharp returns [3, 4, 5, 6]
the above two returns and one does not return? Graphs is obviously a list, but I can"t get the contents of index=1?