title: What is a simple way to check if two words overlap at all in Python using indices
body: <p>I am trying to determine whether or not two words overlap inside of a string by using their indices (start and end positions) and not the word.     </p>
  
  <p>For example:</p>
  
  <pre><code>str = "testme"
  start_word_1 = 0
  end_word_1 = 4
  start_word_2 = 4
  end_word_2 = 6
  </code></pre>
  
  <p>In this example str[0:4] is "test" and str[4:6] is "me".  These do not overlap but the end of word 1 is the same as start of word 2. So these are okay.  I just feel like I'm making it too complicated and there is more simple code for this to cover words that entirely overlap and words that only partially overlap. Thank you!</p>
  
  <p>To clarify overlap:  I mean in the string slice str[0:4] ("test") and str[4:6] ("me")  do not overlap. They are okay.  </p>
  
  <p>But str[0:5] ("testm") does overlap with str[4:6] ("me"). </p>
  
  <p>Also, str[0:6] ("testme") does overlap with str[1:4] ("est"), where this one here "est" is completely inside of "testme." </p>
  
  <p>This is going to be used for text highlighting where I do not want anything to be conflicting highlights.</p>