Algorithm For Simple Calculator Python