Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
from random import choice
MALE_NAMES_FILE = 'dist.male.first'
FEMALE_NAMES_FILE = 'dist.female.first'
LAST_NAMES_FILE = 'dist.all.last'
if __name__ == '__main__':
MALE_NAMES = list(line.split()[0] for line in open(MALE_NAMES_FILE))
FEMALE_NAMES = list(line.split()[0] for line in open(FEMALE_NAMES_FILE))
LAST_NAMES = list(line.split()[0] for line in open(LAST_NAMES_FILE))
randbool = lambda: choice((True, False))
randgender = lambda: choice((MALE_NAMES, FEMALE_NAMES))
for _ in range(100):
fullname = []
# gender for this name
GENDER_NAMES = randgender()
# choose first name
# maybe choose second name
if randbool():
# choose last name
# maybe choose second last name
if randbool():
# print capitalized
print ' '.join(map(str.capitalize, fullname))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment