Hi fellow coders. I have a question about the Extra assignment from Python functions/Medical Insurance Project (https://www.codecademy.com/paths/data-science/tracks/dscp-python-fundamentals/modules/dscp-python-functions/projects/ds-python-functions-project). As you can see in the code below, the estimations of Maria’s, Omar’s and my insurance cost are being printed onto the output window as they should, however, I do not understand why def calculate_costdifference does not print anything onto the output window. Where is the mistake I made? I am a beginner and I cannot find my mistake. I’d appreciate it if someone could help out.
Create calculate_insurance_cost() function below:
def calculate_insurance_cost(name,age,sex,bmi,num_of_children,smoker):
estimated_cost = 250age - 128sex + 370bmi + 425num_of_children + 24000*smoker - 12500
return estimated_cost, print(“The estimated insurance cost for " + name + " is " + str(estimated_cost) + " dollars.”)
Estimate Maria’s insurance cost
maria_insurance_cost = calculate_insurance_cost(name = “Maria”,age = 28, sex = 0, bmi = 26.2, num_of_children = 3, smoker = 0)
Estimate Omar’s insurance cost
Omar_insurance_cost = calculate_insurance_cost(name = “Omar”,age = 35, sex = 1, bmi = 22.2, num_of_children = 0, smoker = 1)
#Estimate my insurance cost
my_insurance_cost =calculate_insurance_cost(name =“Me”, age = 27, sex = 0, bmi = 25.7, num_of_children = 0, smoker = 0)
def calculate_costdifference(my_insurance_cost, Omar_insurance_cost):
cost_difference = Omar_insurance_cost - my_insurance_cost
return cost_difference, print(“The difference in insurance cost is " + str(difference_insurance_cost) + " dollars”)