title: Storing the guessed word in Hangman game
body: <p>How can I store the users input from the hangman function, so every time the for loop runs it remembers the user has already guessed the letter. </p>
  
  <p>When the hangman function runs the first time, if the user's input is 'gera', that's fine, it should then loop back for a fifth guess; the problem is if the user enters 'mo' now, it won't show like this gera _ _ mo, instead it'll print _ _ _ _ _ _ mo; forgetting the users previous 'gera' input. 
  How can I store past inputs so the code recalls what was passed?</p>
  
  <pre><code>def get_guessed_word(secret_word, letters_guessed):
  
      a = ""
      for char1 in secret_word:
          if char1 in letters_guessed:
                  a += char1
          else: 
                  a += "_ "
  
      print(a)
  
  
  
  
  
  
  
  def get_available_letters(letters_guessed):
  
      a = string.ascii_lowercase
      for char1 in a:
          if char1 in letters_guessed:
             a = a.replace(char1,"")
  
  
      print(a)
  
  
  
  
  def hangman(secret_word_user_to_guess):
  
      secret_word_user_to_guess = 'geranimo'
  
      for index in range(6,1,-1):
          print('You have', index,'guesses left.')
          #print('Available letters: abcdefghijklmnopqrstuvwxyz')
          letters_guessed = input('Check a word: ')
          get_guessed_word(secret_word_user_to_guess, letters_guessed)
          print('Available letters:')
          get_available_letters(letters_guessed)
  </code></pre>