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