3 of 153 of 15 Items

Question
What kind of error does this program contain?

age = int(input("Enter your age: "))

print("You are " + str(age) " years old.")

(1 point)
Responses

division by zero

division by zero

syntax error

syntax error

logic error

logic error

data type mismatch

data type mismatch
Skip to navigation

1 answer

The program contains a syntax error.

The specific error in the line:

print("You are " + str(age) " years old.")

is that there is a missing operator (the + sign) between str(age) and " years old.". The correct line should be:

print("You are " + str(age) + " years old.")

This error prevents the program from running properly.