writing a recurring code that takes previous defined instance and creates new one
<p>I have to do something like below. I have one instance <code>v1</code> and from there on, I have to create other instances by running certain function over it in a recurring way.</p>

<pre><code>v2 = vclass.makesomething(v1,a).attribute1()
v3 = vclass.makesomething(v2,a).attribute1()
v4 = vclass.makesomething(v3,a).attribute1()
.
.
.
</code></pre>

<p>The only thing I thought was using a change in name of variable like having <code>v+str(i)</code> but that is a bad way to proceed to the problem. Is there a way to create a recurring code for this?</p>

<p>May be I have phrased the question badly, but I did not know how should I express the problem.</p>

<p>second method I found to work along with what @Duck suggested, </p>

<pre><code>vtemplist = [vertex1]
for i in range(number_of_instances_needed)):
    vtemplist.append(vclass.makesomething(vtemplist[-1],a).attribute1())
</code></pre>