title: 'List index out of range error for strip()
body: <p>I keep getting list index out of range error for following code while using 'strip()'</p>
  <pre><code>    duration = list(dataset['Duration'])
  duration_hrs = []
  dur = []
  for i in range(len(duration)):
      duration[i].split(sep='h')
      duration[i].strip('m')
      dur.append(dur[i])
  dur
  
  IndexError                                Traceback (most recent call last)
  ~\AppData\Local\Temp/ipykernel_2384/3886452692.py in &lt;module&gt;
        6     duration[i].split(sep='h')
        7     duration[i].strip('m')
  ----&gt; 8     dur.append(dur[i])
        9 dur
  
  IndexError: list index out of range
  </code></pre>