I'm looking to create a list of permutations but set the first and last words always the same.
import itertoolslist = ['cow', 'sheep', 'rooster', 'ram', 'donkey', 'horse', 'goat', 'pig']for x in range(1, len(list) + 1): for i in itertools.permutations(list, x): print ("".join(i))
So, for instance, how would I make the first word always be cow and the last word always be pig?