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.")
solved How to end a python program without it going to the next line of code [duplicate]