I want to create a program that prompts for input and based on this input provides with a tailored reply.
As the code is, it works perfectly, with the exception that it is not looping at all. (After running the script in CMD or Powershell it terminates and dies.)
I want the program to return to the input prompt following every run. I think I need the return function but I have no idea what kind of argument to give it.
Also, the ValueError argument is kind of pointless, there is an issue there.
Name = input ("What is your name ? ").strip().lower()
while True:
try:
if Name in ("A"):
print("message for A")
break
else:
if Name in ("N"):
print("message for N")
break
except ValueError:
print ("Sorry, my only purpose is to talk to N and A")
else:
print("dammit")
break