[Python-checkins] cpython (2.7): Make the example cut and pasteable.
raymond.hettinger
python-checkins at python.org
Fri Apr 27 18:57:46 CEST 2012
http://hg.python.org/cpython/rev/3bac1e1a0e0d
changeset: 76576:3bac1e1a0e0d
branch: 2.7
parent: 76572:097b72d73594
user: Raymond Hettinger <python at rcn.com>
date: Fri Apr 27 09:55:31 2012 -0700
summary:
Make the example cut and pasteable.
files:
Doc/library/bisect.rst | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Doc/library/bisect.rst b/Doc/library/bisect.rst
--- a/Doc/library/bisect.rst
+++ b/Doc/library/bisect.rst
@@ -123,9 +123,9 @@
a 'B', and so on::
>>> def grade(score, breakpoints=[60, 70, 80, 90], grades='FDCBA'):
- ... i = bisect(breakpoints, score)
- ... return grades[i]
- ...
+ i = bisect(breakpoints, score)
+ return grades[i]
+
>>> [grade(score) for score in [33, 99, 77, 70, 89, 90, 100]]
['F', 'A', 'C', 'C', 'B', 'A', 'A']
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list