Unable to click next after Lesson 3.6: Python Syntax: Medical Insurance Project

Hello,

I got Python to spit out all the required outputs in this project without error, but it won’t let me click next. I’m assuming the code still isn’t perfect.

The code is here:

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 + 370 * bmi + 425 * num_of_children + 24000 * smoker - 12500

print(“This person’s insurance cost is " + str(insurance_cost) + " dollars.”)

Age Factor

age += 4

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(“People who are four years older have estimated insurance costs that are " + str(change_in_insurance_cost) + " dollars different.”)

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 = 26.2

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 insurance cost for a male with a 26.2 BMI is " + str(change_in_insurance_cost) + " dollars.”)

Smoker

bmi = 26.2

smoker = 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 insurance cost for a male smoker with a 26.2 BMI is " + str(change_in_insurance_cost) + " dollars.”)

Children

bmi = 26.2

smoker = 1

sex = 1

num_of_children = 4

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 for a male smoker with a 26.2 BMI and 4 children is " + str(change_in_insurance_cost) + " dollars.”)

Thank you for you help!

1 Like

Some projects you have to manually click each lesson to say you’ve done it.
It’s so you can be a little more adventurous if you want to try different ways to work through things, or if you wanted to try it out away from Codecademy.

1 Like

Thank you. I didn’t see that the tick boxes on the left all had to be checked.

2 Likes