how to code a yes or no question in python v3.8 1

how to code a yes or no question in python v3.8

Question = input("your question")
if Question == ("yes")
	print ("well done")
elif Question == ("no")
	print ("try again")

Here is what the above code is Doing:
1. It’s asking the user to input a question.
2. If the user inputs “yes”, it prints “well done”.
3. If the user inputs “no”, it prints “try again”.
4. If the user inputs anything else, it prints “I don’t understand”.

Similar Posts