I have the following code:
import networkx as nx
G1 = nx.erdos_renyi_graph(10,0.6)
allNodeCuts = nx.all_node_cuts(G1)
a = list(allNodeCuts)
for i in allNodeCuts:
print(i)
In this version of the code, print(i)
does not occur. However, if I move the code a = list(allNodeCuts)
after the for loop, the loop runs and elements are printed. Why does this happen?