title: Python: IndexError: list index out of range
body: <p>I keep getting this error: </p>
  
  <pre><code>line 4, in timesTwo 
  IndexError: list index out of range
  </code></pre>
  
  <p>for this program:</p>
  
  <pre><code>def timesTwo(myList):
  counter = 0
  while (counter &lt;= len(myList)):
      if myList[counter] &gt; 0:
          myList[counter] = myList[counter]*2
          counter = counter + 1
      elif (myList[counter] &lt; 0):
          myList[counter] = myList[counter]*2
          counter = counter + 1
      else:
          myList[counter] = "zero"
  return myList
  </code></pre>
  
  <p>I'm not exactly sure how to fix the error.  Any ideas?</p>