# 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.

It's hard to answer without the exact question. Currently your code is equivalent to

Indeed, you always take the disjoint union with

`s`

without modifying`s`

.