Help concatinating strings

Please help me. I cannot figure out what I’ve done wrong.

Please paste in your raw code so we can try to reproduce the error.

1 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 + 370 * bmi + 425 * num_of_children + 24000 * smoker - 12500 print("This person's insurance cost is " + str(insurance_cost) + " dollars." # Age Factor # BMI Factor # Male vs. Female Factor # Extra Practice

I would appreciate all the help I can get on this issue as I am stumped.

This doesn’t look like the same code you posted above. Though you are getting an error message with it:

SyntaxError: unexpected EOF while parsing

Typically this would mean the compiler/interpreter (interpreter in Python’s case) scanned through the file but is missing certain characters to finish parsing. First thing I’d look for is a missing closing bracket ), ], }

An example of this could be

a = [
  1,
  2,
  3,
#  \
#   no closing ]
2 Likes

Thanks for your help. I found that I was missing the closing parenthesis in the print statement. :slightly_smiling_face:

2 Likes