Why I got an Index Error?
<pre><code>ant=['1']  
round = 30  

while round:  
    ant += '!'  
    next = []  
    start = 0  

    for current in range(len(ant)):  
        if ant[current] != ant[start]:  
            next.append(str(current-start)+ant[start])  
            start = current  
    ant = "".join(next)  

    round-=1  

print len(ant)  
</code></pre>

<p>I got this source in a blog and tried to run this on 3.2.</p>

<p>(It's about making the ant sequence. <code>[1,11,12,1121,&amp;c]</code></p>

<p>But at line 10, 'IndexError : string index out of range' pops and I hardly understand why.</p>
