Skip to content
Snippets Groups Projects
combinations.py 228 B
Newer Older
  • Learn to ignore specific revisions
  • import itertools
    import re
    l = ['A', 'S', 'U', 'T']
    mask = ''.join(reversed(l))
    for i in range(1,len(l)+1):
        for comb in itertools.combinations(l, i):
            reg = "[^%s]" % ''.join(comb)
            print re.sub(reg,"-", mask)