Skip to content

Instantly share code, notes, and snippets.

@eyaltrabelsi
Last active June 21, 2019 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eyaltrabelsi/071059c8c4b9a27511c5f9f575a13985 to your computer and use it in GitHub Desktop.
Save eyaltrabelsi/071059c8c4b9a27511c5f9f575a13985 to your computer and use it in GitHub Desktop.
Python tricks calculate permutations
>>> 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