Skip to content

Instantly share code, notes, and snippets.

@bjinwright
Created November 16, 2017 18:50
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 bjinwright/88de91ffae2f895980e44c6f91f99ada to your computer and use it in GitHub Desktop.
Save bjinwright/88de91ffae2f895980e44c6f91f99ada to your computer and use it in GitHub Desktop.
Permutations based on range
from itertools import permutations
xlist = ["word1", "word2", "word3"]
def perm_range(obj_list,num):
for perm in permutations(obj_list, num):
print(perm)
perm_range(xlist,2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment