Practice ยท 2 of 2
Finite Cycler
Create a class Cycler(items) that loops over a finite list forever when used with next() directly, BUT supports it = iter(c) producing an iterator that cycles. Implement it as an iterator whose __next__ wraps around using modulo.
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Iterator Drills