-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Closed
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Description
Documentation
In the control flow tutorial -- https://docs.python.org/3/tutorial/controlflow.html -- one of the examples uses 'ok' as the variable name to capture input(). 'Ok' is ambiguous and, at least to me, read as a boolean type when I was learning python with the tutorials. Since the following code processes ok
with some Python-specific syntax (a container check against a tuple of strings), as a new user it was hard to understand what was going on. I propose changing the variable name to 'reply' to more clearly indicate to the tutorial reader that it's storing unevaluated user input, without the affirmative connotations of the name 'ok'. PR forthcoming.
Example in question:
while True:
ok = input(prompt)
if ok in ('y', 'ye', 'yes'):
return True
if ok in ('n', 'no', 'nop', 'nope'):
return False
Linked PRs
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir