Python how to use "try:" not stop when it raises except
<p>I have this code and would like to shorten it. Is this anyway possible? Does not make that much sense to have that often the same code:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>try:
  years = values['year']
except KeyError:
  pass

try:
  tracks = values['track']
except KeyError:
  pass

try:
  statuses = values['status']
except KeyError:
  pass
        </code></pre>
</div>
</div>
</p>

<p>Here you go.    </p>

<pre><code>try:
  years = values['year']
  tracks = values['track']
  statuses = values['status']
except KeyError:
  pass
</code></pre>

python optimization