×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
1
Language: Python
Posted by: Cammy And
Added: Apr 6, 2021 8:57 PM
Views: 3962
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