title: All possible combinations of a word - Python
body: <p>I am making a program where you insert some letters and then the output are all the posible combinations of that letters.</p>
  
  <p>For example: if the input is "ABC" the output should be "A","B","C","AB","AC","BC","ABC","ACB" and so on...</p>
  
  <p>Finally, my idea is to put all that combinations in a set so that it can be intersect with another set containing a certain dictionary of english words being that intersection the ideal output</p>
  
  <p>As far, my script is this one:</p>
  
  <pre><code>import random
  
  p = list(raw_input('Insert some letters: '))
  
  p2 = []
  
  p3 = []
  for j in range((len(p))):
      p2.append(p[j])
  
  for i in range(len(p)):
      a = random.sample(p2,len(p))
      p3.append(str("".join(a)))
      print p3[]
  </code></pre>
  
  <p>Obviously, there are some errors and its not complete. Can you help me to finish or tell me which path should I take? Thanks for reading</p>