Update problem3.py

Added comments.