title: Python access variable in while loop
body: <p>I have this simple Python 3 script</p>
  
  <pre><code>def myfunction(current):
      current += 1
      myvalue = 'Test Value'
      print(current)
      return current
  
  current = 1
  while ( current &lt; 10 ):
      current = myfunction(current)
  </code></pre>
  
  <p>It works great but I am trying to use the myvalue variable in the while loop.  How can I get access to the variable?</p>