Преглед на файлове

Merge pull request #11 from betoboullosa/patch-1

Zip parameters were reversed
Sakis Kasampalis преди 12 години
родител
ревизия
b6f3a82b4d
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  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