import random as rd import string up=list(string.ascii_uppercase) consonants=["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z"] vowels=["a", "e", "i", "o", "u", "y"] count=0 names=[] while count<5000: name="" temp=rd.randint(0, len(up)-1) name+=up[temp] length=rd.randint(2,9) for i in range(length): temp=rd.randint(0, 1) if temp==0: letter=rd.randint(0, len(vowels)-1) name+=vowels[letter] else: letter=rd.randint(0, len(consonants)-1) name+=consonants[letter] names.append(name) count+=1 f=open("names.txt","w") for i in names: f.write(i) f.write("\n") f.close()