This Basic Calculator will receive either integers or decimal numbers (floating point number). If the input is decimal number, output the value in two decimal places. The basic operations are plus and minus.
Sample Code:
def myCalc(op,n1,n2):
# Enter your logic here...
Examples:
Input: '+',1.51,1.31
Output: 2.82
Explanation: 1.51 + 1.31 = 2.82. The first parameter is '+', therefore addition operation.
Input: '-',0.42,0.51
Output: -0.09
Explanation: 0.42 - 0.51 = -0.09. The first parameter is '-', therefore subtraction operation.