object-oriented programming class progression """iterator producing generic progression default iterator produces the whole numbers "" def init (selfstart= ) """initialize current to the first value of the progression "" self current start def advance(self) """update self current to new value this should be overridden by subclass to customize progression by conventionif current is set to nonethis designates the end of finite progression "" self current + def next (self) """return the next elementor else raise stopiteration error ""our convention to end progression if self current is none raise stopiteration elserecord current value to return answer self current advance to prepare for next time self advance return answer return the answer def iter (self) """by conventionan iterator must return itself as an iterator "" return self def print progression(selfn) """print next values of the progression ""join(str(next(self)for in range( )) printcode fragment general numeric progression class