title: Python: String Slicing in a loop
body: <p>Am trying to slice the following string but my Code doesn't return anything past the second loop.</p>
  
  <pre><code>s = "93011NULL                5011005874          A0000000000010000000000001JKL00000000NULL                                              00000000A63"
  
  d = [5,20,20,1,16,9,3,8,50,8,1,2]
  
  start = 0
  for x in d:
      print(s[start:x])
      start += x
  </code></pre>
  
  <p>When I run that code, I only get:</p>
  
  <pre><code>43011
  NULL
  </code></pre>
  
  <p>The rest ten loops print "" i.e. empty strings. Ideally it should loop and slice that string into pieces given the string lengths given in variable d.</p>
  
  <p>What could I be doing wrong?</p>
  
  <p>Thanks.</p>