problem_6.py : Completed