title: How to return that last index of a list Python
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/522372/finding-first-and-last-index-of-some-value-in-a-list-in-python">Finding first and last index of some value in a list in Python</a>  </p>
  </blockquote>
  
  
  
  <p>Hi I was wondering if someone could help me with Python. I am trying to create a code that returns the last index of the last occurrence of an item in a list in a recursive way. So in a list <code>[1,2,3,4,5,2]</code> the last it should return <code>4</code>. It only takes in 2 variables which are the list and the item that it is searching for. If it does not find any matching variable then it returns <code>-1</code>. </p>
  
  <p>So far I have this:</p>
  
  <pre><code>def lstIndex(lst, item):
      if len(lst) == 0:
          return -1
      place = lst[0]
      if place == item:
          print(place)
          #just return the index
          return lst.index(place)
      else:
          return lstIndex(lst[1:],item)
  </code></pre>