chap6.py