Calculator implemented in Python