PEP8 fixes for Chapter 3

Changes to make Chapter 3 PEP8 compliant.

PEP8 still gives two complaints:

92:80: E501 line too long (89 > 79 characters)
182:33: E126 continuation line over-indented for hanging indent

but I like it as it is.