title: If I pass a global variable to a function, then set a new value within the function, will the global variable be updates?
body: <p>I am building a code that looks something like this:</p>
  <pre><code>def firstfunction()
   index1 = 0
   index2 = 0
   somedataframe1 = [...]
   somedataframe2 = [...]
   while somecondition1:
    secondfunction(index1 somedataframe1)
    secondfunction(index2 somedataframe2)
  
  def secondfunction(index somedataframe)
   while somecondition2:
    somedataframe.doathing[index]
    index = index + 1
  </code></pre>
  <p>firstfunction is supposed to iterate through calling secondfunction a number of times for two different dataframes, then second function iterates through a big section of code where it manipulates parts of the supplied dataframe according to the index value, and at the end I want it to increment the index value. And it follows the exact same process separately with both dataframes. When secondfunction changes the value of index, will that change automatically be extended to index1 or index2, whichever 1 is being used at the time? Or will the change be local?</p>