Complete problem6.py