# Check that users have entered a valid # option based on a list ans = "" def string_checker(user_response, valid_ans): user_response = user_response.lower() if user_response in valid_ans: return True return False while True: ans = input("morb?") tf = string_checker(ans, ["yes","no"]) if tf: print(f"you picked {ans}") break else: continue