1
Your task
Define Iterator and Iterable roles
Separate the traversal contract from collections that can be traversed.
Represent a book with its title.
Define hasNext, next, and current on Iterator.
Define createIterator on Iterable.
iterator_contracts.py
Your draft · saved locally
1
Structural feedback only—your code stays in this browser and is not executed.