-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathname_generator.py
43 lines (34 loc) · 969 Bytes
/
name_generator.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
#!/usr/bin/python
# coding=utf-8
import sys, random
print("\n<--------Name generator 0.1.1--------->")
print("Created by Morasiu ([email protected])\n")
try:
lengh = int(raw_input("Enter name lengh: "))
except:
print("Not a number")
sys.exit()
consonants = "bcdfghjklmnqprstvwxz"
vovels = "aeiouy"
name = ""
# Should name start with vovel.
start_vovel = random.randint(0,1)
for x in range(0, lengh):
if len(name) >lengh:
continue
if start_vovel:
if x%2==1:
name += random.choice(consonants)
if random.randint(0,3) == 0:
name += random.choice(consonants)
else:
name += random.choice(vovels)
else:
if x%2==1:
name += random.choice(vovels)
else:
name += random.choice(consonants)
if random.randint(0,3) == 0:
name += random.choice(consonants)
name = name.title()
print("Your name:\n"+ name)