parting shots exercises iterator pattern python internal implementation of the iterator pattern itertools generator functions generator expression parting shots exercises observer pattern parting shots exercises state pattern state pattern parting shots exercises strategy pattern parting shots exercises template method pattern parting shots exercises visitor pattern the visitor pattern parting shots exercises