-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbabynames.py
More file actions
65 lines (58 loc) · 3.68 KB
/
babynames.py
File metadata and controls
65 lines (58 loc) · 3.68 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import re
girlNames = re.split('(?=[A-Z])', 'EmmaIsabellaOliviaSophiaMiaAvaEmilyEvelynAmeliaCharlotteScarlettVictoriaSofiaPenelopeAbigailCamilaHarperMilaAriaLunaElizabethMadisonAveryXimenaLilyElenaAddisonZoeyEllaGraceNatalieAuroraGenesisRileyLaylaVioletAaliyahPaisleyBrooklynLillianMelanieSamanthaChloeQuinnEllieAriannaAubreyAllisonSavannahValentinaZoeKinsleyAudreyLeilaniHannahHazelMayaAlexaArianaStellaLucyNoraLeahGiannaKennedyNevaehBellaDelilahNataliaAliceClaireRubyBrielleElianaJadeHaileyEmiliaEverlyLilianaSerenityNaomiAthenaMadelynMariaSarahGabriellaJocelynWillowAnnaKayleeArielDaleyzaEleanorCoraAdelineIsabelleSadieRyleeAryaIvy')[1:]
boyNames = re.split('(?=[A-Z])', "LiamNoahSebastianAlexanderDanielOliverJulianBenjaminLoganElijahEthanMichaelAidenJamesMateoJacobSantiagoIsaacLukeMasonAdrianAngelJosephLucasMatthewWyattIsaiahJacksonGabrielWilliamJaydenDavidSamuelChristopherJoseEzekielJonathanHenryDylanLuisAnthonyLincolnJesusAndrewCarterChristianXavierAaronEliEzraJoshuaLeviDominicEliasGraysonAsherCalebNathanJosiahIanOwenHunterJackJaxonJohn RyanLeonardoDamianCarlosEastonJuanLeoJeremiahAdamLandonRobertHudsonCarsonDiegoNathanielCharlesTheodoreMiguelAdrielGiovanniMaverickEvanBraydenConnorJordanAustinThomasAydenFranciscoAxelEmilianoJamesonAbelAlejandroGael")[1:]
gender = input("Enter \"boy\" for male names and \"girl\" for female ones: ")
index = -1
finalList = []
letters = input("What letter(s) do you want your name to begin with? ")
def letterFilter(word):
if word[0:len(letters)] == letters.capitalize():
return True
else:
return False
while True:
index += 1
if gender.lower() == "boy":
boyNames = list(filter(letterFilter, boyNames))
if index + 1 <= len(boyNames):
prompt = input(f"Name: {boyNames[index]}. \nSay next to move to the next name or say back to go back to the previous name. Say add to add {boyNames[index]} to your final list. Say done to end: ")
if prompt.lower() == "next":
continue
elif prompt.lower() == "back":
index -= 2
continue
elif prompt.lower() == "add":
finalList.append(boyNames[index])
elif prompt.lower() == "done":
break
else:
print("Please enter only next, back, add, or done.")
index -= 1
continue
else:
break
elif gender.lower() == "girl":
girlNames = list(filter(letterFilter, girlNames))
if index + 1 <= len(girlNames):
prompt = input(f"Name: {girlNames[index]}. \nSay next to move to the next name or say back to go back to the previous name. Say add to add {girlNames[index]} to your final list. Say done to end: ")
if prompt.lower() == "next":
continue
elif prompt.lower() == "back":
index -= 2
continue
elif prompt.lower() == "add":
finalList.append(girlNames[index])
elif prompt.lower() == "done":
break
else:
print("Please enter only next, back, add, or done.")
index -= 1
continue
else:
break
else:
print("Please type in either girl or boy. Try again. ")
exit()
printList = "".join(["\n" + str(finalList.index(i) + 1) + ". " + i for i in finalList])
print(f"Thank you for using this script! Your final list is: {printList}" if len(finalList) > 0 else "I'm sorry that you couldn't find any name you wanted. We keep updating our list frequently, so do come back later and use this script! Thank you!")
print("I hope you can decide on a final name for your baby! Good Luck! :)")