title: What is wrong in my script in this Python 3.x program?
body: <pre><code>import random
  
  word_list = [&quot;elma&quot;, &quot;armut&quot;,&quot;kalem&quot;]
  chosen_word = random.choice(word_list)
  
  stages = ['''
    +---+
    |   |
    O   |
   /|\  |
   / \  |
        |
  =========
  ''', '''
    +---+
    |   |
    O   |
   /|\  |
   /    |
        |
  =========
  ''', '''
    +---+
    |   |
    O   |
   /|\  |
        |
        |
  =========
  ''', '''
    +---+
    |   |
    O   |
   /|   |
        |
        |
  =========''', '''
    +---+
    |   |
    O   |
    |   |
        |
        |
  =========
  ''', '''
    +---+
    |   |
    O   |
        |
        |
        |
  =========
  ''', '''
    +---+
    |   |
        |
        |
        |
        |
  =========
  ''']
  
  
  map_1 = []
  count = 0
  end = False
  for x in range(len(chosen_word)):
      map_1.append(&quot;_&quot;)
  
  if &quot;_&quot; not in map_1:
      end = True
      Print(&quot;YOU WON&quot;)
  if count == 6 and &quot;_&quot; in map_1:
      print(&quot;YOU LOST&quot;)
      end = True
  
  while end == False:
      guess = input(&quot;Guess a letter &quot;).lower()
      count += 1
      print(stages[- count])
      for letter in chosen_word:
          
          if guess == letter:
              a = chosen_word.index(letter)
              map_1[a] = guess
              print(map_1)
          else:
              continue
  
  
  
  print(map_1)
  </code></pre>
  <p>it does not stop when you guess all the letters,
  it gives IndexError: list index out of range every time ı execute the program,I didn't write a part for what happens when you make a wrong guess now ı do the correct guess every time but still it ends like this.I just started the learn in this part ı am stuck ı don't know how to solve this.</p>