I am making a program where you insert some letters and then the output are all the posible combinations of that letters.
For example: if the input is "ABC" the output should be "A","B","C","AB","AC","BC","ABC","ACB" and so on...
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
As far, my script is this one:
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[]
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