diff --git a/iterators-and-generators.html b/iterators-and-generators.html index 805d55f..77a4c61 100644 --- a/iterators-and-generators.html +++ b/iterators-and-generators.html @@ -300,22 +300,22 @@ def plural(noun):
>>> def make_counter(x): -... print 'entering make_counter' -... while True: -... yield x ① -... print 'incrementing x' -... x = x + 1 +... print 'entering make_counter' +... while True: +... yield x ① +... print 'incrementing x' +... x = x + 1 ... ->>> counter = make_counter(2) ② ->>> counter ③ +>>> counter = make_counter(2) ② +>>> counter ③ <generator object at 0x001C9C10> ->>> next(counter) ④ +>>> next(counter) ④ entering make_counter 2 ->>> next(counter) ⑤ +>>> next(counter) ⑤ incrementing x 3 ->>> next(counter) ⑥ +>>> next(counter) ⑥ incrementing x 4