2014-06-02 21:08:53 +02:00
|
|
|
from random import randint
|
|
|
|
|
|
|
|
|
|
|
|
def random_name_generator(first, second, x):
|
|
|
|
"""
|
|
|
|
Generates random names.
|
|
|
|
Arguments:
|
|
|
|
- list of first names
|
|
|
|
- list of last names
|
|
|
|
- number of random names
|
|
|
|
"""
|
|
|
|
names = []
|
2015-05-17 11:49:35 +02:00
|
|
|
for i in range(0, int(x)):
|
2014-06-02 21:08:53 +02:00
|
|
|
random_first = randint(0, len(first)-1)
|
|
|
|
random_last = randint(0, len(second)-1)
|
|
|
|
names.append("{0} {1}".format(
|
|
|
|
first[random_first],
|
|
|
|
second[random_last])
|
|
|
|
)
|
|
|
|
return set(names)
|
|
|
|
|
|
|
|
|
|
|
|
first_names = ["Drew", "Mike", "Landon", "Jeremy", "Tyler", "Tom", "Avery"]
|
|
|
|
last_names = ["Smith", "Jones", "Brighton", "Taylor"]
|
|
|
|
names = random_name_generator(first_names, last_names, 5)
|
2015-05-17 11:49:35 +02:00
|
|
|
print('\n'.join(names))
|