title: Python letter guess game
body: <p>I want to create the hangman python game, so I created a simpler piece of the game. The idea of the game is to guess the letters in a randomly generated word. Here is what I have so far. I listed the problem and questions I have at the bottom.</p>
  <pre><code>import random
  
  
  words = ['holiday', 'american', 'restaurant', 'computer', 'highschool', 'programming']
  random_word = random.choice(words)
  count = 0
  
  
  while True:                                     #repeatedly asks you to guess the letter in a random word
      guess = str(input(&quot;Guess a letter:  &quot;))
      guess = guess.lower()
  
  
      if guess in random_word:             #checks if the letter you input is in the random generated word
          print(&quot;Yay, its in the word&quot;)
        
      
      else:                          
          count += 1
          print(&quot;Not in the word, attempts: %d&quot; % count)
          
          if count &gt; 5:                   
              print(&quot;You have reached max attempts&quot;)
              print(&quot;Sorry, but hangman died! You lose&quot;)
              break
          else:
              continue
  </code></pre>
  <p>The problem I have: <strong>When the user guesses a letter, they can guess it again infinite times. How can I make it so that the user can't repeatedly guess the same letter?</strong></p>
  <p>Is there a way to make sure the user doesn't guess the same letter? This could be a problem in an actual hangman game when there are several letters that are the same. Any help/feedback appreciated, thanks!</p>