Coding examples from the book "Programming Python" Ed 4; python 3.2