Просмотр исходного кода

Merge pull request #11 from betoboullosa/patch-1

Zip parameters were reversed
Sakis Kasampalis 12 лет назад
Родитель
Сommit
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"""
     """Counts by word numbers, up to a maximum of five"""
     numbers = ["one", "two", "three", "four", "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
     # 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
         yield number
 
 
 # Test the generator
 # Test the generator