I’m confused because I am not getting the same answers as the Hints and I have tried to find an answer to my question but can’t find one specifically that answers my question.
Step 1: I created the initials variables below
create the initial variables below
age = 28
sex = 0
bmi = 26.2
num_of_children = 3
smoker = 0
Step 2: I created my formula like this as per instructed:
I can’t see what your error may be; is this the same order that you ran your code in? Simply running the first two sections in order outputs 5469.0 as per the instructions. Sure you’re not altering insurance_costbetween the assignments and the print?
age = 28
sex = 0
bmi = 26.2
num_of_children = 3
smoker = 0
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.")
Out: This person's insurance cost is 5469.0 dollars.
Ahh thank you tgrtim. That must have been what happened. I had skipped ahead to the age factor and beyond and perhaps that’s why my output showed 7000 and not 5469.0. I will start the project again from the beginning.
This is a response that we see here quite a lot. I can totally relate to feeling like that in the past, so I understand where you’re coming from. It’s tough putting ourselves “out there” for others to comment. BUT, please don’t let what others might think influence your learning process. If you don’t understand something, google it, ask questions, use the search here in the forums…b/c I can guarantee you that others have been in the same situation.