Programmer's Calculator in Python