diff options
author | Raymond Hettinger <python@rcn.com> | 2012-04-27 16:55:31 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2012-04-27 16:55:31 (GMT) |
commit | 9aa13959166a209fd25ccf6df01d8de781bb0edb (patch) | |
tree | b14570cc521ab7f18a8d01613cf0c86ce3a41951 | |
parent | a68bdc720a7bc71b6cd672bfb79e2b0e627814bc (diff) | |
download | cpython-9aa13959166a209fd25ccf6df01d8de781bb0edb.zip cpython-9aa13959166a209fd25ccf6df01d8de781bb0edb.tar.gz cpython-9aa13959166a209fd25ccf6df01d8de781bb0edb.tar.bz2 |
Make the example cut and pasteable.
-rw-r--r-- | Doc/library/bisect.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/bisect.rst b/Doc/library/bisect.rst index 27ab526..64a362e 100644 --- a/Doc/library/bisect.rst +++ b/Doc/library/bisect.rst @@ -123,9 +123,9 @@ based on a set of ordered numeric breakpoints: 90 and up is an 'A', 80 to 89 is 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'] |