title: Compare 2 values and only return the index
body: <p>Let's say we have 2 Elements:</p>
  <pre><code>x = (123, 'aab', 1)
  y = (456, 'cca', 2) or y = None 
  </code></pre>
  <p>where <code>x[0]=Key, x[1]=Value, x[2]=Index</code> and <code>y[0]=Key, y[1]=Value, y[2]=Index</code>, where <code>y</code> can be potentially be <code>None</code></p>
  <p>Is there an elegant way in Python to compare the <code>Value</code> of both Elements with the <code>min</code> function and return the corresponding <code>Index</code>? Considering the case, that <code>y</code> can be potentially be <code>None</code>. For example</p>
  <pre><code>x = (123, 'aab', 1)
  y = (456, 'cca', 2) 
  </code></pre>
  <p>would return <code>1</code> since <code>min(123,456) = 123 </code> so <code>x</code> has the smaller value.
  or</p>
  <pre><code>x = (123, 'aab', 1)
  y = None
  </code></pre>
  <p>would also return <code>1</code></p>