Hello,
Ditto on the struggles of task 13, it is causing my brain to melt. I’m a total newbie to coding. If anyone can help me please?
To recap the task’s instructions:
- Modify the
calculate_insurance_cost()
function so that it returns two values – the output message and the estimated cost.
- Create a second function to calculate the difference between the insurance costs (given as inputs) of any two individuals and print a statement saying:
"The difference in insurance cost is xxx dollars."
For the first part, I’m not sure if I have modified ‘calculate_insurance_cost()’ correctly? It seems a bit redundant to have output_msg in the return? Unless I’ve interpreted the question incorrectly 
For the second part, I have defined the difference function at the end of the code but I can’t seem to get any output in the terminal (is that the correct terminology?) I get the following error message:
Traceback (most recent call last):
File “script.py”, line 35, in
diff_in_cost(maria_insurance_cost, omar_insurance_cost)
File “script.py”, line 31, in diff_in_cost
diff = abs(a-b)
TypeError: unsupported operand type(s) for -: ‘tuple’ and ‘tuple’
@tgrtim you provided a link explaining what a Tuple is but it may as well have been in Sumerian 
This is my code so far…
# Create calculate_insurance_cost() function below:
def calculate_insurance_cost(name, age, sex, bmi, num_of_children, smoker):
estimated_cost = 250*age - 128*sex + 370*bmi + 425*num_of_children + 24000*smoker - 12500
output_msg = "The estimated insurance cost for " + name + " is " + str(estimated_cost) + " dollars."
print(output_msg)
return output_msg, estimated_cost
# Initial variables for Maria
age = 28
sex = 0
bmi = 26.2
num_of_children = 3
smoker = 0
# Estimate Maria's insurance cost
maria_insurance_cost = calculate_insurance_cost("Maria", age, sex, bmi, num_of_children, smoker)
# Initial variables for Omar
age = 35
sex = 1
bmi = 22.2
num_of_children = 0
smoker = 1
# Estimate Omar's insurance cost
omar_insurance_cost = calculate_insurance_cost("Omar", age, sex, bmi, num_of_children, smoker)
def diff_in_cost(a, b):
diff = abs(a-b)
print("The difference in insurance cost is " + str(diff) + " dollars.")
return diff
diff_in_cost(maria_insurance_cost, omar_insurance_cost)