title: Go back to previous line in python?
body: <p>Im trying to create the following such that it reassigns the variable as I go.</p>
  
  <pre><code>def train(old_strength, old_energy): 
      train = input("What would you like to do now?\n'strentgh' or 'rest'\n&gt;")
  
      if train == 'strength':
          strength = old_strength+10
          energy = old_energy-10
  
  
          if energy &lt;= 0:
              print ("You do not have enough energy to do this.")
  
          else:   
              pass
  
          print ("You have gained 10 strength, and now have %d strength and %d energy left" %(strength, energy))
          old_strength = strength)
          old_energy = energy)        
          train(old_strength, old_energy)
  </code></pre>
  
  <p>Im trying to get it so that when it goes back to the 'train' input, it will then use the new strength and energy values for the next time.
  At the moment I get the error</p>
  
  <pre><code>Traceback (most recent call last):
    File "settler.py", line 127, in &lt;modul
      train(10, 50)
    File "settler.py", line 37, in train
      train(old_strength, old_energy)
  TypeError: 'str' object is not callable
  </code></pre>
  
  <p>How do I fix this?
  Many Thanks in advance</p>