01-28-2020, 10:22 AM
This should do what you want? Basically walks the binary tree of choices - either capital or digit until we run out of one or the other.
#!/usr/bin/python3
def talktalkmask(mask,caps,digits):
if (caps>=1):
talktalkmask(mask+'?1',caps-1,digits)
if (digits>=1):
talktalkmask(mask+'?2',caps,digits-1)
if caps==0 and digits==0:
print("ABCDEFGHIJKLMNOPQRSTUVWXYZ,0123456789,"+mask)
talktalkmask('',5,3)
#!/usr/bin/python3
def talktalkmask(mask,caps,digits):
if (caps>=1):
talktalkmask(mask+'?1',caps-1,digits)
if (digits>=1):
talktalkmask(mask+'?2',caps,digits-1)
if caps==0 and digits==0:
print("ABCDEFGHIJKLMNOPQRSTUVWXYZ,0123456789,"+mask)
talktalkmask('',5,3)