Python Programming - Generators - Discussion

Discussion Forum : Generators - General Questions (Q.No. 44)
44.
What is the purpose of the itertools.count(start, step) function when used with generators?
It generates an infinite sequence of numbers starting from the specified value
It stops the generator after one iteration
It initializes the generator with the provided start value
It generates a sequence of numbers with a specified step value
Answer: Option
Explanation:
itertools.count(start, step) generates an infinite sequence of numbers starting from the specified value, with an optional step value.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.