title: Check if rectangles coords intersect with python
body: <p>I'm training with a website which ask me to make a program which will ask for the coords of two rectangles and check if the rectangles intersect. Then, when I send the program, the website tests it a few times. It asks for the x min, x max, y min and y max of A rectangle and then, B rectangle.</p>
  
  <p>Here's what I do:</p>
  
  <pre><code>xmin_a = int(input())
  xmax_a = int(input())
  ymin_a = int(input())
  ymax_a = int(input())
  
  xmin_b = int(input())
  xmax_b = int(input())
  ymin_b = int(input())
  ymax_b = int(input())
  
  if xmin_a &lt; xmax_b &lt;= xmax_a and (ymin_a &lt; ymax_b &lt;= ymax_a or ymin_a &lt;= ymin_b &lt; ymax_a):
     print('YES')
  elif xmin_a &lt;= xmin_b &lt; xmax_a and (ymin_a &lt; ymax_b &lt;= ymax_a or ymin_a &lt;= ymin_b &lt; ymax_a):
     print('YES')
  elif xmin_b &lt; xmax_a &lt;= xmax_b and (ymin_b &lt; ymax_a &lt;= ymax_b or ymin_b &lt;= ymin_a &lt; ymax_b):
     print('YES')
  elif xmin_b &lt;= xmin_a &lt; xmax_b and (ymin_b &lt; ymax_a &lt;= ymax_b or ymin_b &lt;= ymin_a &lt; ymax_b):
     print('YES')
  else:
     print('NO')
  </code></pre>
  
  <p>Unfortunately, it doesn't work and I don't get why. Any idea?</p>
  
  <p>PS: <a href="http://data.france-ioi.org/Task/7b0ee4fb57949c3db1f694afcef9d1a1//exemple.png" rel="nofollow">http://data.france-ioi.org/Task/7b0ee4fb57949c3db1f694afcef9d1a1//exemple.png</a></p>