Irritating Python loop error?
<p>ive been attempting this problem for a while and I cant seem to get the issue out.</p>

<pre><code>listy2=['fun','super','Stop']
listy=['great','life','Stop','toys','nothing','Stop']
listpool=[listy,listy2]
current=[]
total=[]
nested=True
for i in listpool:
    for line in enumerate(i):
        if (line[0]==0):
            current.append(line[1])
            #skipping first line
            continue
        if (line[1].strip()!="") and (nested==True):
            current.append(line[1])
            nested=False
            continue
        if (line[1].strip()=="Stop"):
            nested=True
            continue
    total.append(current)
    #current[:] = []
print total
</code></pre>

<p>The program should output a list of lists. 
[[first element of list, nested things],[first element of list, nested things]]</p>

<p>Nested things are like:</p>

<pre><code>hello
blah blah
Stop
</code></pre>

<p>the nested thing in this case would be hello
The lists can have multiple nested things.</p>

<pre><code>cool
blah blah
Stop
good
blah blah
Stop
</code></pre>

<p>the nested thing in this example would be cool and good, (as you can tell, the things in the middle do no matter)</p>

<p>In my code it SHOULD output </p>

<pre><code>[['fun','super'],['great','life','toys']]
</code></pre>

<p>however it does not.</p>

<p>Sorry if I cannot explain this question well, as English is not my first language but I am getting used to it. If you have any questions or comments please comment here. Sorry if I have done something stupid. It would also be nice if you could explain my error, but that would not be necessary.
Thanks.</p>
