prep ex39.py