I'm looking for a script that could tell me all possible combinations
input (9)
output (8+1)(7+2)(6+3)(5+4)(9)
input (10)
output (9+1)(8+2)(7+3)(6+4)(5+5)(10)
I would still appreciate the ability to select as many digits as possible in the example it is 2 to 1 (even if only two is enough) something this way
there should be an exit at three
input (10)
output (7+1+2)(6+3+1)(5+4+1)(4+4+2)(3+6+2)(1+6+3)
here is at least part of the possible results
I'm a beginner and the only thing I can do is combine all the words but this is at another level thank you for your help
word = ""
word_array = []
for c in word:
word_array.append(c)
import itertools
results = list(itertools.permutations(word_array))
o = ""
for r in results:
o += "".join(r)+"\r\n"
print("".join(r))
f = open(""+str(word)+".txt", "a")
f.write(o)
f.close()
exit()