Hello! I'm trying to make a name generator, but because of the while loop, the error message keeps repeating over and over again. How do I stop this?
Code:
while True:
try:
NameCount = int(NameCount)
if NameCount == 0:
print("I thought you might try that, try again. Womp womp.")
if NameCount < 0:
print("Seriously? Negative names? Nope. No can do. Try again.")
if NameCount > 0:
print("Sounds good. Here are the names.")
break
except ValueError:
print("That won't work.")```