problem024.py : Completed