My Medical Insurance Project

Greetings Friends!
I’m working on the Medical Insurance Project in the Data Science Career Path.

I’m running into a problem at Task 11.
I’ve changed the binary value of sex from 0 to 1.
Task 12 says I should have outputted a negative value for change_in_insurance_cost after completing Task 11; however, I received a positive value…
…and I told my vocational counsellor that I’d be done with the project by day’s end…
Can someone please help me figure out where I’m going wrong?

Here’s what my program looks like:

create the initial variables below

age = 28
sex = 0
bmi = 26.2
num_of_children = 3
smoker = 0

Add insurance estimate formula below

insurance_cost = 250 * age - 128 * sex + 270 * bmi + 425 * num_of_children + 24000 * smoker - 12500

Age Factor

age += 4
new_insurance_cost = 250 * age - 128 * sex + 370 * bmi + 425 * num_of_children + 24000 * smoker - 12500
print(“This person’s insurance cost is " + str(insurance_cost) + " dollars.”)

change_in_insurance_cost = new_insurance_cost - insurance_cost

print(“The change in cost of insurance after increasing the age by 4 years is " + str(change_in_insurance_cost) + " dollars.”)

BMI Factor

age = 28
bmi += 3.1

new_insurance_cost = 250 * age - 128 * sex + 370 * bmi + 425 * num_of_children + 24000 * smoker - 12500

change_in_insurance_cost = new_insurance_cost - insurance_cost
print(“The change in estimated insurance cost after increasing BMI by 3.1 is " + str(change_in_insurance_cost) + " dollars.”)

Male vs. Female Factor

bmi -= 3.1
sex = 1

new_insurance_cost = 250 * age - 128 * sex + 370 * bmi + 425 * num_of_children + 24000 * smoker - 12500

change_in_insurance_cost = new_insurance_cost - insurance_cost
print(“The change in estimated cost for being male instead of female is " + str(change_in_insurance_cost) + " dollars.”)

Extra Practice

Can you post a link to the exercise?

This is a duplicate thread.

So sorry.
…I’m not quite sure how to navigate the forums as yet…

Apologies.

My Medical Insurance Project

No worries! :slight_smile:
I thought I was seeing things. haha. (and I’ve already had coffee too.)