Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to ask a yes or no question on python

answer = input("Enter yes or no: ") 
if answer == "yes": 
    # Do this. 
elif answer == "no": 
    # Do that. 
else: 
    print("Please enter yes or no.") 
 
PREVIOUS NEXT
Tagged: #question #python
ADD COMMENT
Topic
Name
5+6 =