I am making a survey that asks the user about age, gender, etc., using a while-loop. Is there any way to make the program exit the loop when the user enters certain strings like "cya" or "bye"?
I know that I could make an if-statement after every input, but is there an faster/easier way to do this?
Example of what I want to achieve:
while (user has not entered "cya"):
age = int(input("How old? "))
gender = input("gender? ")
EDIT: this example was very short, but the survey i'm making is very long, so testing every variable is too time consuming.