-
- def calculate(firstOperand, secondOperand, operand):
- if operand == '+' :
- print(firstOperand + secondOperand)
- elif operand == '-':
- print(firstOperand - secondOperand)
- elif operand == '*':
- print(firstOperand * secondOperand)
- elif operand == '/':
- print(firstOperand / secondOperand)
-
-
- def menu():
- print("Welcome to the calculator program")
- print("Please enter your operands and operator")
- firstOperand = raw_input("\nFirst operand:")
- secondOperand = raw_input("\nSecond operand:")
- operand = raw_input("\n Operand:")
- return (firstOperand, secondOperand, operand)
-
- (fistOperand, secondOperand, operand) = menu()
-
- calculate(firstOperand, secondOperand, operand)
-