From: Raymond Hettinger Date: Fri, 27 Apr 2012 16:55:31 +0000 (-0700) Subject: Make the example cut and pasteable. X-Git-Tag: v2.7.4rc1~876 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9aa13959166a209fd25ccf6df01d8de781bb0edb;p=python Make the example cut and pasteable. --- diff --git a/Doc/library/bisect.rst b/Doc/library/bisect.rst index 27ab526efb..64a362eb93 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']