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
Get step-by-step solutions from verified subject matter experts
