Skip to content

Instantly share code, notes, and snippets.

@Ruhshan
Last active November 10, 2016 19:34
Show Gist options
  • Save Ruhshan/41286e4df57d3c826ee4b85af31c0ea5 to your computer and use it in GitHub Desktop.
Save Ruhshan/41286e4df57d3c826ee4b85af31c0ea5 to your computer and use it in GitHub Desktop.
import itertools
def all_perm(word):
# prints all permutation to a given word
for p in list(itertools.permutations(word)):
print ''.join(p)
all_perm("abcde")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment