Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Looping in graphs

When I run the code:

l=[1,2,3,4,5]
s=graphs.CompleteGraph(1)
for i in l:
    t=s.disjoint_union(graphs.CompleteGraph(i+1))
t.order()

I get the output as $7$, which not as the expected $21$. How do I rectify this? How to loop over graphs? Any hints? Thanks beforehand.