garywood schrieb:
def ask_ok(prompt, retries=4, complaint="Yes or no, please!"):
while True:
password = input("enter something")
if password in ('y', 'ye', 'yes'): return True
if password in ('n', 'no', 'nope'): return False
retries = retries - 1
if retries < 0:
raise IOError('refusenik user')
print(complaint)
------------------------------------------------------------------------
--
http://mail.python.org/mailman/listinfo/python-list
What's your problem, anyway? It seems to work perfectly fine, except that
you ignore the prompt variable.
--
http://mail.python.org/mailman/listinfo/python-list