Question: Python 3 Implement a function getAns() that takes a string representing a question as a parameter and obtains and returns a yes or no answer

Python 3

Implement a function getAns() that takes a string representing a question as a parameter and obtains and returns a yes or no answer to the question from the user. The function should prompt the user with the question and indicate that the user must answer either yes or no to the question. If the user enters either yes or no (in any possible capitalization) the function returns an all lowercase version of the answer (e.g. either 'yes' or 'no'). If the user enters anything other than yes or no, the function repeatedly prompts the user for another answer. The following shows several sample executions of the function:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!