title: Python search and compare Dict-values (coordinates-list) to a list (bbox) and return specific key
body: <p>I have a dict with values like this (coordinates = [cx1, cx2, cy1, cy2]):</p>
  <pre><code>&gt; co_list =
  [
    {
      &quot;data.01&quot;: [
        6.9490666,
        47.4897206,
        7.0073678,
        47.5169333
      ]
    },
    {
      &quot;data.02&quot;: [
        6.9493157,
        47.4627392,
        7.0075872,
        47.4899521
      ]
    }
  ]
  </code></pre>
  <p>from an user input I got a list with 4 coordinates (bbox = [bx1, by1, bx2, by2])</p>
  <blockquote>
  <p><code>bb_list = [6.974532, 47.469739, 7.000004, 47.481432]</code></p>
  </blockquote>
  <p>I want to check if the bb_list fits in the co_list's values, if the bottom left or the upper rigth corner is within a certain range, the according key shall be returned. How can I iterate the values of bb_list over each value/values of co_list and they should be compared by something like that:</p>
  <blockquote>
  <p>if bx1 &gt;= cx1 and &lt;= cx2 and if by1 &gt;= cy1 and &lt;= cy2 or if bx2 &gt;= cx1 and &lt;= cx2 and if by2 &lt;= cy2 and &gt;= cy1</p>
  </blockquote>
  <p>Any help welcome, thanks!</p>