Skip to content

Instantly share code, notes, and snippets.

@SaraM92
Created September 29, 2020 18:58
Show Gist options
  • Save SaraM92/f4e963d946641638eb37e105552d879e to your computer and use it in GitHub Desktop.
Save SaraM92/f4e963d946641638eb37e105552d879e to your computer and use it in GitHub Desktop.
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