Update hw6.py

Problem 4 solved!