This is the code which i have written for medical insurance project under functions lesson
function to find the cost of insurance with formula given in the exercise
acknowledgement =“The estimated insurance cost for “+name+” is “+str(estimated_cost)+” dollars.”
maria_insurance_cost = calculate_insurance_cost(“Maria”,28,0,26.2,3,0)
omar_insurance_cost = calculate_insurance_cost(“Omar”,35,1,22.2,0,1)
Function find the difference between cost of insurance of two persons below
print(“The difference in insurance between 1st and 2nd person”,diff,“dollars”)
When i run the code, the below output is shown with error.
The estimated insurance cost for Maria is 5469.0 dollars.
The estimated insurance cost for Omar is 28336.0 dollars.
The estimated insurance cost for Anas is 3289.0 dollars.
Traceback (most recent call last):
File “script.py”, line 19, in
File “script.py”, line 16, in difference
TypeError: unsupported operand type(s) for -: ‘tuple’ and ‘tuple’
I was trying to assign one of the values of returned values of a the first function as an argument to second function.
Does anybody know how to do that?