Skip to content

Instantly share code, notes, and snippets.

@tuck1s
Created April 12, 2021 12:42
Show Gist options
  • Save tuck1s/03a52e1bb77fb576f923dff77e7d81a9 to your computer and use it in GitHub Desktop.
Save tuck1s/03a52e1bb77fb576f923dff77e7d81a9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# External dependencies: https://github.com/treyhunner/names
import random, names
count_default = 10 # Default length of list
def random_n_digits(n):
s = ''
for i in range(n):
s += random.choice('0123456789')
return s
# Need to treat ensureUnique only with mutating list methods such as 'add', so the updated value is returned to the calling function
def random_recip(domain):
return names.get_first_name().lower() + '.' + names.get_last_name().lower() + random_n_digits(3) + '@' + domain
# -----------------------------------------------------------------------------------------
# Main code
# -----------------------------------------------------------------------------------------
for i in range(count_default):
print(random_recip('t-online.de'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment