problem_8.py : Completed