diff options
author | Raymond Hettinger <python@rcn.com> | 2003-12-02 07:38:30 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-12-02 07:38:30 (GMT) |
commit | 25695282a57e3212acb48ab4d022bf2ea4092e1d (patch) | |
tree | 71e9990958cb60d480b67ca56d1f571adb8fbd21 /Doc | |
parent | 1d7323e4e79c3ee3e99004037e5215620aa0b3f8 (diff) | |
download | cpython-25695282a57e3212acb48ab4d022bf2ea4092e1d.zip cpython-25695282a57e3212acb48ab4d022bf2ea4092e1d.tar.gz cpython-25695282a57e3212acb48ab4d022bf2ea4092e1d.tar.bz2 |
Convert a 0/1 to False/True.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/tut/tut.tex | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/tut/tut.tex b/Doc/tut/tut.tex index 56dd395..1c9b0bc 100644 --- a/Doc/tut/tut.tex +++ b/Doc/tut/tut.tex @@ -1420,8 +1420,8 @@ arguments than it is defined def ask_ok(prompt, retries=4, complaint='Yes or no, please!'): while True: ok = raw_input(prompt) - if ok in ('y', 'ye', 'yes'): return 1 - if ok in ('n', 'no', 'nop', 'nope'): return 0 + if ok in ('y', 'ye', 'yes'): return True + if ok in ('n', 'no', 'nop', 'nope'): return False retries = retries - 1 if retries < 0: raise IOError, 'refusenik user' print complaint |