title: How to increment list index in a function
body: <p>im trying to print the next item in the list by using this function I defined below :</p>
  
  <pre><code>List = [1,2,3,4,5]
  
  def next():
      i=0
      if (i&lt;4): 
          i= i + 1
  
      print (List[i])
  </code></pre>
  
  <p>The output of this remains as the second index and doesn't increments no matter how many times i call it</p>
  
  <p>Thanks.  </p>