title: Use a while loop to print words from the list until a word of length 4 would be printed
body: <p>I am trying to use a while loop to print out words from a list that is in a text file. I need the loop to stop once it reaches a word that is 4 characters long. With my current code I am getting an infinite loop.</p>
  
  <pre><code>wordsFile = open("words.txt", 'r')
  words = wordsFile.read()
  wordsFile.close()
  wordList = words.split()
  
  # While loop displays names based on length of words in list
  
  print("\nSelected words are:")
  while words in wordList:
  if len(words) != 4:
      print(words)
  </code></pre>
  
  <p><strong>Sample Desired Output</strong></p>
  
  <p>Selected words are:</p>
  
  <ul>
  <li><p>Abate</p></li>
  <li><p>Chicanery</p></li>
  <li><p>disseminate</p></li>
  <li><p>gainsay</p></li>
  <li><p>latent</p></li>
  <li><p>aberrant</p></li>
  <li><p>coagulate</p></li>
  <li><p>dissolution</p></li>
  <li><p>garrulous</p></li>
  </ul>