ans = input("please enter n or y") while ans != "n" and ans != "y": ans = input("please enter n or y") if ans == "y": print(ans, "is a y") elif ans == "n": print(ans, "is a n") else: print("please reenter") print(ans, "is right")