title: Split a list into parts based on a set of indexes in Python
body: <p>What is the best way to split a list into parts based on an arbitrary number of indexes? E.g. given the code below</p>
  
  <pre><code>indexes = [5, 12, 17]
  list = range(20)
  </code></pre>
  
  <p>return something like this</p>
  
  <pre><code>part1 = list[:5]
  part2 = list[5:12]
  part3 = list[12:17]
  part4 = list[17:]
  </code></pre>
  
  <p>If there are no indexes it should return the entire list.</p>