title: Python hangman game for loop
body: <p>When I guess the letter it keeps applying the letter. for example
  say the word is words, then I would guess the letter d, then it would do
  ddddd. it uses that letter for the whole word. here is my code.</p>
  
  <pre><code>import random
  print(" Welcome to the HangMan game!!\n","You will have six guesses to get the answer correct, or you will loose!!!",)
  
  lines = open("../WordsForGames.txt").read() 
  line = lines[0:] 
                      #lines 24-28 Randomly generate a word from a text file
  words = line.split() 
  myword = random.choice(words)
  print(myword)
  
  
  words = myword
  fake = '_'*len(myword)
  count = 0
  print(fake)
  guesses = 0
  guess = input("Enter a letter you would like to guess: ")
  fake = list(fake)  #This will convert fake to a list, so that we can access and change it.
  
  for re in range(0, len(myword)):#For statement to loop over the answer (not really over the answer, but the numerical index of the answer)
      fake[re] = guess    #change the fake to represent that, EACH TIME IT OCCURS
      print(''.join(fake))
  
  if guess != (''.join(fake)):
      print("The letter ", guess,"was in the word. Guess another letter please!")
      guess = input("Enter another letter you would like to guess: ")      
      fake[re] = guess    #change the fake to represent that, EACH TIME IT OCCURS
      print(''.join(fake))
  </code></pre>