can someone tell me why this doesn't work please python 3
Michael Hartl
mikehartl at web.de
Wed Jan 14 10:01:11 EST 2009
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.
More information about the Python-list
mailing list