problem_9.py : Completed