Browse Source

Zip parameters were reversed

Beto Boullosa 12 years ago
parent
commit
134c9980f2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      iterator.py

+ 1 - 1
iterator.py

@@ -5,7 +5,7 @@ def count_to(count):
     """Counts by word numbers, up to a maximum of five"""
     numbers = ["one", "two", "three", "four", "five"]
     # enumerate() returns a tuple containing a count (from start which defaults to 0) and the values obtained from iterating over sequence
-    for pos, number in zip(numbers, range(count)):
+    for pos, number in zip(range(count), numbers):
         yield number
 
 # Test the generator