Update q3.py

Needs review