I want to make the output of my code without brackets and commas:
import itertools
import pprint
run = 1
while run != 0:
number = raw_input('\nPlease type between 4 and 8 digits and/or letters to run permutation: ')
if len(number) >= 4 and len(number) <= 8:
per = list(itertools.permutations(number))
pprint.pprint(per)
print '\nNumber of possible combinations: ',len(per),'\n'
elif number == 'exit':
run = 0
else:
raw_input('length must be 4 to 8 digits and/or letters. Press enter to exit')
run = 0
So it prints out a list with each combination in a new line. How do I print it without getting the brackets and commas? I still want to be able to call per[x] to get a certain combination. Any help appreciated! Thank you.
use
join()