finished ex36.py