title: converting to list comprehension
body: <p>I have this code:</p>
  
  <pre><code>result = []
  for x in [10, 20, 30]:
      for y in [2, 3, 4]:
          if y &gt; 0:
              result.append(x ** y)
  </code></pre>
  
  <p>result</p>
  
  <pre><code>[100, 1000, 10000, 400, 8000, 160000, 900, 27000, 810000]
  </code></pre>
  
  <p>I'm trying to convert it to list comprehension with no luck(new in python)</p>
  
  <p>This is my attempt:</p>
  
  <pre><code>print [ x ** y if y &gt; 0 for x in [10, 20, 30] for y in [2, 3, 4]]
  </code></pre>
  
  <p>But there is a problem in the statement, any help will be most appropriated.</p>
  
  <p>error:</p>
  
  <pre><code>  File "&lt;stdin&gt;", line 1
      print [ x ** y if y &gt; 0 for x in [10, 20, 30] for y in [2, 3, 4]]
                                ^
  SyntaxError: invalid syntax
  </code></pre>