Question: Write a python function perform _ arithmetic _ operation to perform basic arithmetic operations on two numbers. The function takes 3 inputs: num 1 ,
Write a python function performarithmeticoperation to perform basic arithmetic operations on two numbers. The function takes inputs: num num and symbol in which symbol denotes the particular arithmetic operation to be performed on the numbers num and num The function should then calculate and return the result.
The arithmetic operations and their corresponding symbols are:
Arithmetic operation symbol
Addition ie num num
Subtraction ie num num
Multiplication ie num num
Division ie numnum
Note that the function should handle division by zero and invalid input which corresponds to symbol being anything other than the four symbols listed above gracefully by returning
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
