Python implementation of Head First Patten examples