fixed exam-3.py