why do nested control statements on one line fail in python?
<p>I have been trying to convert a simple execution such as:</p>

<pre><code>for x in xrange(10):
    if x % 2 == 0:
        print x, 'is even'
</code></pre>

<p>to a one liner version:</p>

<pre><code>for x in xrange(10): if x % 2 == 0: print x, 'is even'
</code></pre>

<p>which gives me:</p>

<pre><code>  File "foo.py", line 1
    for x in xrange(10): if x % 2 == 0: print x, 'is even'
                      ^
SyntaxError: invalid syntax
</code></pre>

<p><strong>I don't see any ambiguity in here. Is there a particular reason why this fails?</strong></p>
