ex39.py