There was an error while loading. Please reload this page.
1 parent 89e65c5 commit 6876dd0Copy full SHA for 6876dd0
1 file changed
behavioral/iterator.py
@@ -11,9 +11,7 @@
11
def count_to(count):
12
"""Counts by word numbers, up to a maximum of five"""
13
numbers = ["one", "two", "three", "four", "five"]
14
- # enumerate() returns a tuple containing a count (from start which
15
- # defaults to 0) and the values obtained from iterating over sequence
16
- for pos, number in zip(range(count), numbers):
+ for number in numbers[:count]:
17
yield number
18
19
# Test the generator
0 commit comments