So I’ve copied this code more or less exactly, but I keep getting this same typeError message:
TypeError: unsupported operand type(s) for -: ‘tuple’ and ‘tuple’
I’m not really familiar with what a “tuple” is and I’m not sure why I’d be hitting this error. Here’s my exact code below. Any ideas why I might be hitting this error message?
def calculate_insurance_cost(age, sex, bmi, num_of_children, smoker, name):
estimated_cost = 250age - 128sex + 370bmi + 425num_of_children + 24000*smoker - 12500
output_message = print(“The estimated insurance cost for " + str(name) + " is " + str(estimated_cost) + " dollars.”)
return output_message, estimated_cost
maria_insurance_cost = calculate_insurance_cost(28, 0, 26.2, 3, 0, name = “Maria”)
omar_insurance_cost = calculate_insurance_cost(35, 1, 22.2, 0, 1, name = “Omar”)
Austin_insurance_cost = calculate_insurance_cost(29, 1, 26, 0, 0, name = “Austin”)
def diff_insurance_costs(x, y):
diff_cost = x - y
Print(“The difference in insurance cost is " + str(diff_cost) + " dollars.”)
return diff_cost
diff_insurance_costs(omar_insurance_cost, maria_insurance_cost)