Created
January 24, 2017 21:36
-
-
Save svvitale/7de5b06ba5deacadad456b35038c8c48 to your computer and use it in GitHub Desktop.
What does this do?
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
import random | |
import string | |
import re | |
allowable = re.sub(r'[IO10]', '', (string.ascii_uppercase + string.digits)) | |
def combos(place): | |
for char in allowable: | |
if place == 1: | |
yield char | |
else: | |
for subchar in combos(place - 1): | |
yield char + subchar | |
four_digit_combos = combos(4) | |
enough_for_1000_people = random.sample(list(four_digit_combos), 1000) | |
print(enough_for_1000_people) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment