how to ask a yes or no question on python

Solutions on MaxInterview for how to ask a yes or no question on python by the best coders in the world

showing results for - "how to ask a yes or no question on python"
Lilli
03 May 2019
1answer = input("Enter yes or no: ") 
2if answer == "yes": 
3    # Do this. 
4elif answer == "no": 
5    # Do that. 
6else: 
7    print("Please enter yes or no.")