Python indentation syntax error -- if/else tree
<p>I got an error in the printing program I wrote.</p>

<pre><code>from variables import *    
li = []
for i in range(len(word)):
    if i in graph:
        for j in graph[i]:
            if j in graph[i]:
                li.append(len(graph[i][j])
            else: # line 23
                li.append(0)
    else:
        for j in range(len(word)):
            li.append(0)
    print li
    del li[:]
</code></pre>

<p>The error is </p>

<pre><code>File "eval.py", line 23
else:
   ^
SyntaxError: invalid syntax
</code></pre>

<p>Where did I go wrong?</p>