def get_confirmation(prompt):
"""Method to confirm decisions
Args:
prompt(str): Question to ask the user
Returns:
(bool): True indicating yes, False indicating no
"""
decision = False
while True:
confirm = input("{} (y/n): ".format(prompt))
if confirm.lower() == "y":
decision = True
break
elif confirm.lower() == "n":
decision = False
break
else:
print("Enter 'y' or 'n' for 'yes' or 'no'")
return decision
评论列表
文章目录