title: How to extract an equal sequence of elements in a list in Python?
body: <p>I have a more specific question, but I haven't found the answer yet. I'm really desperate and would be really happy if someone knew the answer. Thank you in advance for reading ...</p>
  <p>I have a list in Python that looks something like this:</p>
  <blockquote>
  <p>[&quot;h&quot;, &quot;e&quot;, &quot;l&quot;, &quot;l&quot;, &quot;o&quot;, &quot;h&quot;, &quot;e&quot;, &quot;l&quot;, &quot;l&quot;, &quot;o&quot;, &quot;h&quot;, &quot;e&quot;, &quot;l&quot;, &quot;l&quot;, &quot;o&quot;]</p>
  </blockquote>
  <p>Now I want to shorten the list so that a block of elements is filtered out that is repeated many times. This means that this list becomes:</p>
  <blockquote>
  <p>[&quot;h&quot;, &quot;e&quot;, &quot;l&quot;, &quot;l&quot;, &quot;o&quot;]</p>
  </blockquote>
  <p>Does anyone know how this works? The problem: The list can always look different, maybe like this:</p>
  <blockquote>
  <p>[&quot;b&quot;, &quot;y&quot;, &quot;e&quot;, &quot;b&quot;, &quot;y&quot;, &quot;e&quot;, &quot;b&quot;, &quot;y&quot;, &quot;e&quot;]</p>
  </blockquote>
  <p>Thank you very much and I would really appreciate your answer!</p>