the code sample in chap07 of 'heads first python'