calculator.py updated for Python 3 compatibility.