Redoing ex31.py for practice.