Merge pull request #9 from uttamo/patch-1
Use random.choice instead of random.randint
This commit is contained in:
commit
c2f695f649
@ -1,4 +1,4 @@
|
|||||||
from random import randint
|
from random import choice
|
||||||
|
|
||||||
|
|
||||||
def random_name_generator(first, second, x):
|
def random_name_generator(first, second, x):
|
||||||
@ -10,13 +10,8 @@ def random_name_generator(first, second, x):
|
|||||||
- number of random names
|
- number of random names
|
||||||
"""
|
"""
|
||||||
names = []
|
names = []
|
||||||
for i in range(0, int(x)):
|
for i in range(x):
|
||||||
random_first = randint(0, len(first)-1)
|
names.append("{0} {1}".format(choice(first), choice(second)))
|
||||||
random_last = randint(0, len(second)-1)
|
|
||||||
names.append("{0} {1}".format(
|
|
||||||
first[random_first],
|
|
||||||
second[random_last])
|
|
||||||
)
|
|
||||||
return set(names)
|
return set(names)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user