For #5 add test issue4.py, rewrite main issue4.py so that can be imported without writing to stdout.