Complete problem5.py