title: How to remove any duplicates in python output
body: <p>I have a python dictionary maker that I am working on. I have been piecing it together but I need help. When I make it submit to a text file, or the output, it has duplicate words before new ones. For example this could be the output one time:
  a
  a
  a
  b
  a
  c</p>
  
  <p>I need the output to be
  a
  b
  c</p>
  
  <p>Or (to help those that dont get it) another output example is:
  abc
  cba
  abc
  cba
  bca</p>
  
  <p>when it should be:
  aaa
  aab
  aac
  aba
  abb
  abc
  aca
  acb
  acc
  baa</p>
  
  <p>and so forth.</p>
  
  <p>Can anyone help me? this is the code I have so far (it saves to a .txt file named wordlist.txt)</p>
  
  <pre><code>import string, random
  
  minimum=input('Please enter the minimum length of any give word to be generated: ')
  maximum=input('Please enter the maximum length of any give word to be generated: ')
  wmaximum=input('Please enter the max number of words to be generate in the dictionary: ')
  
  alphabet =raw_input("What characters should we use to generate the random words?: ")
  string=''
  FILE = open("wordlist.txt","w")
  for count in xrange(0,wmaximum):
    for x in random.sample(alphabet,random.randint(minimum,maximum)):
        string+=x
    FILE.write(string+'\n')
    string=''
  print''
  FILE.close()
  print 'DONE!'
  end=raw_input("Press Enter to exit")
  </code></pre>