2efacb8b49f8 — Greg Malcolm 12 years ago
From icmurry, github: Fixed issue: https://github.com/gregmalcolm/python_koans/issues#issue/2 (sum_it uninteresting)

    Made the change detailed in the ticket, namely bringing value into the
    loop, making it more obvious that the state of value  is retained between
    iterations.
2 files changed, 2 insertions(+), 2 deletions(-)

M python 2/koans/about_generators.py
M python 3/koans/about_generators.py
M python 2/koans/about_generators.py +1 -1
@@ 81,7 81,7 @@ class AboutGenerators(Koan):
         for num in seq:
             # The local state of 'value' will be retained between iterations
             value += num
-        yield value
+            yield value
 
     def test_generator_keeps_track_of_local_variables(self):
         result = self.sum_it(range(2,5))

          
M python 3/koans/about_generators.py +1 -1
@@ 84,7 84,7 @@ class AboutGenerators(Koan):
         for num in seq:
             # The local state of 'value' will be retained between iterations
             value += num
-        yield value
+            yield value
 
     def test_generator_keeps_track_of_local_variables(self):
         result = self.sum_it(range(2,5))