Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Python
Posted by: Cammy And
Added: Apr 6, 2021 8:57 PM
Views: 1
Tags: no tags
  1. def prompt(question):
  2.     while "the answer is invalid":
  3.         reply = str(input(question+' [Y/N]: ')).lower().strip()
  4.         if reply == 'y':
  5.             return True
  6.         if reply == 'n':
  7.             return False