I wanna make a program which creates n of families and allows firstnames not to equal to lastnames or firstnames.
names = ["tri", "ahmad", "doni", "lulu"]
firstnames = ["tri", "ahmad"]
lastnames = "tri"
while firstnames == lastnames or firstnames in firstnames:
firstnames = random.choice(names)
So it will brutally change firstnames to random value from names but firstnames and lastnames
However it doesnt stop. How can i solve this problem?
Have you tried to run this code on your local IDE and what's the output. I think there's nothing to correct in your code. Not getting an output is probably a sololearn issue cos i edited your code and added some print statement at the top level and there's no output