HELLO, I'm stuck with Medical Insurance Project

Hello All,

I am working on the PHYTON Medical Insurance Project,

As I can see, the code is runing OK, and I dont inderstand why I am not able to pass to the next exercice, could you help me please!

This is the code I have done.

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
print(“The estimated insurance cost for " + name+ " is " + str(estimated_cost) + " dollars.” )
return estimated_cost

Estimate Maria’s insurance cost

maria_insurance_cost = calculate_insurance_cost( “Maria”,28,0,26.2,3,0)

Estimate Omar’s insurance cost

omar_insurance_cost = calculate_insurance_cost(“Omar”, 35, 1, 22.2, 0, 1)

patula_insurance_cost = calculate_insurance_cost(“Patula”, 40, 1, 22.2, 0, 1)

def diference_two_insurance_cost(one_cost, two_cost):
diference = one_cost - two_cost
print( “The difference in insurance cost is " + str(diference) + " dollars”)

diference_two_insurance_cost(maria_insurance_cost, omar_insurance_cost)


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 Patula is 29586.0 dollars.
The difference in insurance cost is -22867.0 dollars

Please include a link to the lesson and please format your code so it is readable. (Select the gear icon and the pre formatted text option, then add your code).

Also, if I’m not mistaken, some of these projects you’re supposed to mark the tasks complete as you go through them; it’s not automatic.


Please upload the code on GitHub and leave the link here its not properly readable and the indentations are not right too.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.