[New-bugs-announce] [issue23116] Python Tutorial 4.7.1: Improve ask_ok() to cover more input values

Amy report at bugs.python.org
Fri Dec 26 20:42:14 CET 2014


New submission from Amy:

https://docs.python.org/3/tutorial/controlflow.html#default-argument-values
def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):
    while True:
        ok = input(prompt)

Suggestion: change to "ok = input(prompt).lower()" in order to cover values with capitalized characters such as "Yes" or "NO".

----------
messages: 233114
nosy: amyluo
priority: normal
severity: normal
status: open
title: Python Tutorial 4.7.1: Improve ask_ok() to cover more input values
type: enhancement
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23116>
_______________________________________


More information about the New-bugs-announce mailing list