# -*- coding=utf-8 -*-defcount_to(count):
numbers = ["one", "two", "three", "four", "five"]
for pos, number in zip(range(count), numbers):
yield (pos, number)
count_to_two = lambda: count_to(2)
count_to_five = lambda: count_to(5)
if __name__ == '__main__':
print('Counting to two...')
for number in count_to_two():
print number
print('\nCounting to five...')
for number in count_to_five():
print number
#output:
Counting to two...
(0, 'one')
(1, 'two')
Counting to five...
(0, 'one')
(1, 'two')
(2, 'three')
(3, 'four')
(4, 'five')