-
Notifications
You must be signed in to change notification settings - Fork 0
/
script9.py
48 lines (40 loc) · 1.42 KB
/
script9.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import random, string
vowels='aeiouy'
consonants='bcdfghjklmnpqrstvwxz'
letters=vowels+consonants
letter_input_1=input("What letter do you want? Enter 'v' for vowels, 'c' for consonants, 'l' for any letter: ")
letter_input_2=input("What letter do you want? Enter 'v' for vowels, 'c' for consonants, 'l' for any letter: ")
letter_input_3=input("What letter do you want? Enter 'v' for vowels, 'c' for consonants, 'l' for any letter: ")
#print(letter_input_1 + letter_input_2 + letter_input_3)
def generator():
# get letter 1
if letter_input_1 == 'v':
letter1 = random.choice(vowels)
elif letter_input_1 == 'c':
letter1 = random.choice(consonants)
elif letter_input_1 == 'l':
letter1 = random.choice(letters)
else:
letter1 = letter_input_1
# get letter 2
if letter_input_2 == 'v':
letter2 = random.choice(vowels)
elif letter_input_2 == 'c':
letter2 = random.choice(consonants)
elif letter_input_2 == 'l':
letter2 = random.choice(letters)
else:
letter2 = letter_input_2
# get letter 3
if letter_input_3 == 'v':
letter3 = random.choice(vowels)
elif letter_input_3 == 'c':
letter3 = random.choice(consonants)
elif letter_input_3 == 'l':
letter3 = random.choice(letters)
else:
letter3 = letter_input_3
name = letter1 + letter2 + letter3
return(name)
for i in range(20):
print(generator())