title: How can I find the longest word in a text file?
body: <p>I have created a function to find the longest word in a text file and finding the longest word(s) in a text file that can  be made from 9 letters. I'm new to python and I'm creating a game similar to countdown.</p>
  
  <p>I've created a function to find the longest word in the text file. What I want now is to create python code to find the longest word(s) that can be formed from the 9 letters. </p>
  
  <p>Each letter can only be used once. So from 'qugteroda', I should get rag outed, outraged, out dare, out read, outrage,readout. I'm using python 3.3</p>
  
  <p>my code looks like this:</p>
  
  <pre><code>def Words():
      qfile=open('dict.txt','r')
      long=''
      for line in qfile:
      if len(line)&gt;len(long):
          long=line
      return long
  </code></pre>