title: How to use the output of one loop in another iteration?
body: <p>So I am trying to build a program of a hangman which would ask the user for his inputs and after each try would use his answers</p>
  <pre><code>for i in range(0, 3):
      print(&quot;\nTRY NO. &quot;, end='')
      print(i + 1)
      alphabet = input()
      if alphabet in words_list[ind]:
          for u in words_list[ind]:
              if alphabet == u:
                  print(alphabet, end='')
              else:
                  print(&quot;_&quot;, end='')
  </code></pre>
  <p>Till here the output for a word like QWWERTY and if the user entered W would be something like <em>WW</em>__.
  What should I do to keep this result and have the user enter his input for <em>WW</em>__ in his 2nd try i.e. his previous attempt's result is visible to him.</p>
  <pre><code>    ans = input()
      if ans == words_list[ind]:
          print(&quot;YOU SAVED HIM, YOU SAVED THE MAN!!!&quot;)
          break
      else:
          print(&quot;BETTER LUCK NEXT TIME&quot;)
          flag = flag + 1
          continue
  
  else:
      print(&quot;SORRY WRONG WORD, TRY AGAIN!&quot;)
  </code></pre>
  <p>Sorry for the description but this is my first question, would really appreciate if answered</p>