Sponsored Reserved space — layout preview until AdSense is connected
easy +12 pts

Infinite counter generator

Generator that never ends.

Implement `counter(start=0, step=1)` as a generator yielding start, start+step, start+2*step, …

Constraints

start and step are integers; step ≠ 0.

Example

>>> c = counter(0, 2)
>>> [next(c) for _ in range(5)]
[0, 2, 4, 6, 8]
12 points ~12 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

while True: yield val; val += step.
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.
Sponsored Reserved space — layout preview until AdSense is connected