Answer the question
In order to leave comments, you need to log in
Is there a program for iterating words?
You need a program to enumerate words.
What would she do like this:
word1 word2 word3 word4
And in the end it was:
word1 word2 word4 word3
word1 word2 word4 word3
word1 word3 word4 word2
word1 word4 word3 word2
word2 word3 word1 word4
And so on.
Thank you very much in advance
Answer the question
In order to leave comments, you need to log in
Python 2.6+
import itertools,sys
print('\n'.join([' '.join(a) for a in list(itertools.permutations(sys.argv[1:]))]))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question