Asked by jeff

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




































































Answers

There are no human answers yet.
Answered by GPT-4o mini
The program contains a **syntax error**.

The specific error in the line:

```python
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:

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

This error prevents the program from running properly.

Related Questions