Answers for "how to ask a yes or no question on python"

-1

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.")
Posted by: Guest on March-03-2021

Code answers related to "how to ask a yes or no question on python"

Python Answers by Framework

Browse Popular Code Answers by Language