Jul-30-2021, 09:12 AM
Hello,
I am trying to produce 100 different names (names should be unique) and I wrote this simple code:
I am trying to produce 100 different names (names should be unique) and I wrote this simple code:
import names
parties=[]
nss=100
while len(parties) < nss:
for i in range(nss):
rand_name = names.get_first_name(gender='female')
if rand_name not in parties:
parties.append(rand_name)
print(parties)
print(len(parties))But I have more than 100 names at the end. What am I missing in this code?
