title: creating a sequential pair of time lists
body: <p>I have a list of times that look like this, every time is incremented by 5 mins with the last time being 23:59:00.000</p>
  
  <pre><code>list_of_times = ['2020-01-30 00:00:00.000', '2020-01-30 00:05:00.000', '2020-01-30 00:10:00.000', '2020-01-30 00:15:00.000', '2020-01-30 00:20:00.000'... '2020-01-30 23:59:00.000']
  </code></pre>
  
  <p>What I want to do is end up with a list of time pairs like this:</p>
  
  <pre><code>list_of_pairs = [['2020-01-30 00:00:00.000', '2020-01-30 00:05:00.000'],['2020-01-30 00:05:00.000','2020-01-30 00:05:00.000'], ... ['2020-01-30 23:55:00.000','2020-01-30 23:59:00.000']]
  </code></pre>
  
  <p>So note how in the list_of_pairs the end time of the first pair  <code>['2020-01-30 00:00:00.000', '2020-01-30 00:05:00.000'</code>], is the start time for the next pair <code>['2020-01-30 00:05:00.000','2020-01-30 00:05:00.000']</code></p>
  
  <p>My code:</p>
  
  <pre><code>start_times = list_of_times[::2]
  end_times = list_of_times[1::2]
  count = 0
  try:
      for item in start_times:
          pair_of_times.append([start_times[count],end_times[count]])
          count +=1
  except:
      pass
  print(pair_of_times)
  </code></pre>
  
  <p>But my result is as expected, note how the start time of the 2nd pair is 2020-01-30 00:10:00.000'. I would like it to be the end time of the previous pair. Here is how my result looks now :</p>
  
  <pre><code>[['2020-01-30 00:00:00.000', '2020-01-30 00:05:00.000'], ['2020-01-30 00:10:00.000', '2020-01-30 00:15:00.000']...]
  </code></pre>
  
  <p>Not sure how to slice correctly, or even if slicing is the right method to get the result I'm looking for. I'm also open to generating the time from scratch since I'm given the start and end time ie start = '2020-01-30 00:00:00.000'. end = '2020-01-30 23:59:00.000'</p>