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.")
More Related Contents:
- Why am getting an "elif" syntax error showing invalid syntax in python [closed]
- python 3.2 if-else
- Python Code that returns true while key is pressed down false if release?
- Else clause on Python while statement
- What is the recommended way to break a long if statement? (W504 line break after binary operator)
- a pythonic way of doubling consecutive binary bits [closed]
- How to display position of an element in an array? [closed]
- how to check numbers in a list in python
- How do chained assignments work?
- How to save a dictionary to a file?
- How to read and write INI file with Python3?
- Pip – Fatal error in launcher: Unable to create process using ‘”‘
- Django TemplateDoesNotExist?
- Schedule a repeating event in Python 3
- What is sys.maxint in Python 3?
- How to melt 2 columns at the same time?
- Configure Django and Google Cloud Storage?
- (discord.py) Getting a list of all of the members in a specific voice channel
- Why isn’t .ico file defined when setting window’s icon?
- How to capitalize the first letter of every sentence?
- Python 3 urllib produces TypeError: POST data should be bytes or an iterable of bytes. It cannot be of type str
- Printing result of the zip() function in Python 3 gives “zip object at ” [duplicate]
- Meaning of python -m flag
- Attempt to call an undefined function glutInit
- ImportError: Cannot load backend ‘TkAgg’ which requires the ‘tk’ interactive framework, as ‘headless’ is currently running
- Is there a way to get a line number from an ElementTree Element
- Python making combined bar and line plot with secondary y-axis
- List comprehension scope error from Python debugger
- Error: No module named ‘fcntl’
- Multiple lines of x tick labels in matplotlib