-
-
Save eyaltrabelsi/071059c8c4b9a27511c5f9f575a13985 to your computer and use it in GitHub Desktop.
Python tricks calculate permutations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> for p in itertools.permutations([1, 2, 3, 4]): | |
>>> print(''.join(str(x) for x in p)) | |
123 | |
132 | |
213 | |
231 | |
312 | |
321 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment