spacepaste

  1.  
  2. def calculate(firstOperand, secondOperand, operand):
  3. if operand == '+' :
  4. print(firstOperand + secondOperand)
  5. elif operand == '-':
  6. print(firstOperand - secondOperand)
  7. elif operand == '*':
  8. print(firstOperand * secondOperand)
  9. elif operand == '/':
  10. print(firstOperand / secondOperand)
  11. def menu():
  12. print("Welcome to the calculator program")
  13. print("Please enter your operands and operator")
  14. firstOperand = raw_input("\nFirst operand:")
  15. secondOperand = raw_input("\nSecond operand:")
  16. operand = raw_input("\n Operand:")
  17. return (firstOperand, secondOperand, operand)
  18. (fistOperand, secondOperand, operand) = menu()
  19. calculate(firstOperand, secondOperand, operand)
  20.