title: Python - How to use try/except statement in dictionary
body: <p>I was trying to do this, but It didn't work.  Just to clarify I want value to equal list[0] if it exists.  Thanks.</p>
  
  <pre><code>    dictionary = {
      try:
          value : list[0],
      except IndexError:
          value = None
      }
  </code></pre>