I'm new in programming and my first assessment is creating a program that asks a few questions to the user. The first question requires the user to answer Y or N and I would like to force the user to only do it, by keep asking them the same question until the user type Y or N, without accepting any other letter or number or symbols. If the answer in N, then the user is asked another question (which is apparently working for me) and so on.
I am trying to use while loop and now I'm lost:
print("Phase vaccine rollout (PVR) v1.0")
print("==========================")
phase1a = input("Are you a quarantine and border worker,\n\
prioritised frontline healthcare worker, or\n\
an aged care/disability care staff member or resident (Y/N)?: ")
while phase1a.upper() == "Y" or "N":
if phase1a.upper() == "Y":
print()
print("Vaccines will be made available to you in Phase 1a")
print()
exit()
elif phase1a.upper() == "N":
print("__________________________")
phase1b = input("Are you a health care worker, or\n\
a critical or high risk worker (including defence,\n\
police, fire, emergency services and meat processing (Y/N)?: ")
continue
else:
break
# --- and from here I will continue with the phase1b...
Thank you!