Python classes

Hello, I’m trying to calculate the estimated insurance cost with a formula that was given to us but the print is not working. I think that’s where the mistake.

def estimated_insurance_cost(self):

estimated_cost = 250 * self.age - 128 * + 370 * self.bmi + 425 * self.num_of_children + 24000 * self.smoker - 12500

print( + “'s estimated insurance cost is " + str(estimated_cost) + " dollars.”)


Hello @object0210195723 ,

Couple things to keep in mind for your next post - format your code, include a lesson link and error message. It helps everyone understand your problem more clearly.

[How to] Format code in posts - Getting Started - Codecademy Forums

Try checking your double quotes and single quotes in your print statement.


thank you for bringing my attention the need of a \ in my print!

1 Like
