We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8eb0735 + 5b74528 commit c2f695fCopy full SHA for c2f695f
1 file changed
scripts/13_random_name_generator.py
@@ -1,4 +1,4 @@
1
-from random import randint
+from random import choice
2
3
4
def random_name_generator(first, second, x):
@@ -10,13 +10,8 @@ def random_name_generator(first, second, x):
10
- number of random names
11
"""
12
names = []
13
- for i in range(0, int(x)):
14
- random_first = randint(0, len(first)-1)
15
- random_last = randint(0, len(second)-1)
16
- names.append("{0} {1}".format(
17
- first[random_first],
18
- second[random_last])
19
- )
+ for i in range(x):
+ names.append("{0} {1}".format(choice(first), choice(second)))
20
return set(names)
21
22
0 commit comments