Created
September 29, 2020 18:58
-
-
Save SaraM92/f4e963d946641638eb37e105552d879e to your computer and use it in GitHub Desktop.
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, combination | |
#Getting all permutations of a particular length. | |
seq = permutations(['b','i','r', 't', 'h'], 5) | |
#print list of permutations | |
for p in list(seq): | |
print(p) | |
#Getting all combination of a particular length. | |
combi = combinations(['b','i','r', 't', 'h'], 5) | |
#Print the list of combinations | |
for c in list(combi): | |
print(c) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment