title: Split list at a specific value
body: <p>I am trying to write a code that splits lists in a class of lists in two when a certain value is a middle element of the list and then produce two lists where the middle element becomes the end element in the first list and the first element in the second one.</p>
  
  <p>There can be more than n middle elements in the list so the result must be n+1 lists.</p>
  
  <p>Example:</p>
  
  <pre><code>A = [[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],[16,17,18,19,20,21,22,23,24,25],[26,27,28,29]]
  
  P = [4,7,13,20]
  n = len(Points) # in this case n = 4
  </code></pre>
  
  <p>I am looking for a result that looks like this:</p>
  
  <pre><code>A = [[0,1,2,3,4],[4,5,6,7],[7,8,9,10,11,12,13],[13,14,15],[16,17,18,19,20],[20,21,22,23,24,25],[26,27,28,29]]
  </code></pre>
  
  <p>Since n = 4 and it will produce 5 lists, note that the answer has 6 lists because the last list doesn't have any value of P in and therefore stays intact.</p>
  
  <p>I haven't been able to produce anything as I am new to python and it is hard to formulate this problem.</p>
  
  <p>Any help is appreciated!</p>