Question: Create a function (in PYTHON!) which will do arithmetic operations, - addition, subtraction, multiplication and division - based on the character input. The function will

Create a function (in PYTHON!) which will do arithmetic operations, - addition, subtraction, multiplication and division - based on the character input. The function will take 3 parameters: one integer value, one character and another integer value. The function will only return the calculation. If an invalid character is being entered it will return Invalid Operation

EXAMPLE PROGRAM RUN

(calculator 6, '+' ,2)

8

(calculator 6, '-' ,2)

4

(calculator 6, '*' ,2)

12

(calculator 6, '/' ,2)

3

(calculator 6, '&' ,2)

'Invalid operation'

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!