How to end a python program without it going to the next line of code [duplicate]

while True:
    choice = input ("Do you want to play?")
    if choice == "yes" 
        print("Great!")
        break # Go to the game
    elif choice == "no" 
        print("Goodbye.")
        break # nothing
    else:
        print("Please answer yes or no.")

Leave a Comment