title: python secret word program
body: <p>I'm trying to write a program where the user has to guess a letter in the goal of unlocking the secret word. If the secret word is guessed correctly before the maximum 8 guesses, the function returns true else the function returns false. For some reason my function just doesn't produce the right output. I would enter the letter 'a' and it would print "Letters guessed so far: ['a']" and then the program would end. I need help in fixing this issue.</p>
  
  <pre><code>secretWord = 'hello'
  lettersGuessed = []
  
  
  def isWordGuessed(secretWord,lettersGuessed):
    guess  = 0
    while guess &lt;= 8:
      secretLetters = list(secretWord)
      secretWordLen = len(secretLetters)
      letter = input('Enter a letter: ')
      lettersGuessed.append(letter)
  
      print('Letters guessed so far: ',lettersGuessed)
  
      if letter not in secretLetters:
          guess += 1
  
      while letter in secretLetters:
          secretLetters.remove(letter)
  
      if secretLetters == []:
         return True
      else:
         return False
  
  
  
     isWordGuessed(secretWord,lettersGuessed)
  </code></pre>