summaryrefslogtreecommitdiffstats
path: root/Doc/library/bisect.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/bisect.rst')
-rw-r--r--Doc/library/bisect.rst6
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']