title: Ternary operator python not working on dict assignment
body: <p>I'm new to python.</p>
  <p>Today i'm trying to simplify this:</p>
  <pre><code>        for x in t:
              if x in hash:
                  hash[x] += 1
              else:
                  hash[x] = 1
  </code></pre>
  <p>To this:</p>
  <pre><code>        for x in t:
              hash[x] += 1 if x in hash else hash[x] = 1
  </code></pre>
  <p>Then i got an error:</p>
  <pre><code>SyntaxError: invalid syntax
                                             ^
      hash[x] += 1 if x in hash else hash[x] = 1
  Line 8  (Solution.py)
  </code></pre>
  <p>I thought i'm doing an expression here? as shown in <a href="https://stackoverflow.com/questions/7818992/python-ternary-operator-with-assignment">this question</a></p>
  <p>What am i doing wrong?</p>