char = input("Enter Char's to Combine with the Keyword: ")
n = int(input("Number of Char's Added to Keyword (2-9) :"))
letters = itertools.product(char,repeat=int(n))
for i in letters:
 wrdLst.append(word_list[0] + "".join(i) + '\n')
save(wrdLst)

I'm using Itertools to create a wordlist using a baseword set by the user, word_list[0] .It currently works but I'd like to be able to perform the same thing on the entire list of items and not just word_list[0]

1

There are 1 best solutions below

0
Tim Roberts On

Pretty obvious, isn't it?

for word in word_list:
  for i in letters:
    wrdLst.append( word + ''.join(i) )

You should add the newline when you write it, not in the list.

What's the point of this? Your list will get very large very quickly and isn't very useful. With an 8 letter word and n=8, you're already at 16 million variations per word.