My code is meant to ask a user to pick which household animal that is preferred. The answer should be either "cats" or "dogs".
household_animal = (input("Which household animal do you prefer?"))
if household_animal in ("cat", "dog"):
print("Thanks for your input on which household animal you prefer!")
else:
print("This is not a household animal, please pick again.")
I am uncertain about how to make the program continue to ask for input until the user picks either "cat" or "dog". If correct input is detected, it should no longer ask for more input.
How do I solve this?