title: Solving Word Puzzle?
body: <p>I am trying to create a program that finds all words of a certain length or greater that contain required letter x and the remaining letters in the word are drawn from the letters in y (this is a puzzle found in the NYT).</p>
  
  <p>Since I am trying to do this step-by-step, I first create a wordlist of all words of length >= the required length, and then create a list of all words that contain the required letter.</p>
  
  <p>Then I go through each letter in each of the words of that list to see if they contain a letter not in the inputted letters, or use that letter more times than in the inputs. If that happens, I remove the word from the list.</p>
  
  <p>At the end, I print all of the words that satisfy the condition. However, it's not working and I'm not sure why. I'm sure I'm making a really rookie error here but would love any suggestions. Thanks very much, and please forgive my horrific code, I've only been learning Python for two weeks!</p>
  
  <pre><code>data = [line.strip() for line in open("wordsEn.txt", 'r')]
  req = str(input("Please enter the required letter "))
  set = str(input("Please enter the other letters "))
  completeset = req + set
  lenreq = int(input("Please enter minimum word length "))
  panswers = []
  usedict = [word for word in data if len(word) &gt;= lenreq]
  for word in usedict:
      if req in word:
          panswers = panswers + [word]
  panswerstest = panswers
  for word in panswerstest:
      for w in word:
          if word.count(w) &gt; completeset.count(w):
              try:
                  panswers.remove(word)
              except:
                  continue
  print(panswers)
  </code></pre>