title: Python -- Do things to current element and next element in list?
body: <p>I want to preform a function, let's say print, on the current and next element in the list. How do you do this without getting an error when you get to the last element in the list?</p>
  
  <pre><code>some_list = ["one", "two", "three"]
  </code></pre>
  
  <p>desired output:</p>
  
  <pre><code>curr_item: "one"
  next_item: "two"
  
  curr_item: "two"
  next_item: "three"
  
  curr_item: "three"
  next_item: "end"
  </code></pre>
  
  <p>What I have tried:</p>
  
  <pre><code>index = 0
  for item in list_name[:-1]:
      print item, list_name[index+1]
      index = index+1
  </code></pre>