title: Python recursive list search function
body: <p>I have to write a recursive function to search a list for a specific value. The function is supposed to find whether or not the number is in the list and if it is it will return the list index of that value.</p>
  
  <p>For example:</p>
  
  <pre><code>search([1,2,3,4,5],3)
  </code></pre>
  
  <p>should return:</p>
  
  <pre><code>2
  </code></pre>
  
  <p>as 3 appears in list index 2.</p>
  
  <p>Right now I have:</p>
  
  <pre><code>def search(myList, number):
      if myList[0] == number:
          return myList[0]
      return search(myList[1:], number)
  </code></pre>
  
  <p>and it keeps returning 3 for the same function call I had earlier. Any help will be greatly appreciated.</p>