title: How can you reset variables to their original value in python?
body: <p>I am making a hangman game and I want to be able to reset the lives and score back to their original value (6&amp;0). This code does not seem to work.</p>
  
  <pre><code>def newwords():
      newgamewords.append(input('Enter new word: '))
      print('Do you want to add any more words? yes or no?')
      answer=input()
      if answer == 'yes':
          newwords()
      else:
          while len(guessedletters) &gt; 0 : guessedletters.pop()
          while len(displayletters) &gt; 0 : displayletters.pop()
          lives = 6
          finalscore=0
           score
          gamewords[:] = newgamewords
          hangmangame()
  </code></pre>
  
  <p>Here is the code at the beginning of the game (these variables are not in any definition, i have made every variable in my code global just to be sure):</p>
  
  <pre><code>lives=6
  score=0
  </code></pre>