Created
November 16, 2017 18:50
-
-
Save bjinwright/88de91ffae2f895980e44c6f91f99ada to your computer and use it in GitHub Desktop.
Permutations based on range
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
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