Which of the following statements is TRUE?

(1 point)

• A name error occurs if the variable is referenced before it is declared.

• A name error occurs if a colon is put in the wrong place.

• A name error occurs if an else statement is used without an if statement.

• A name error occurs if two equals signs are used instead of one.

1 answer

The TRUE statement among the provided options is:

• A name error occurs if the variable is referenced before it is declared.

This statement correctly identifies a situation where a name error occurs in programming. The other statements describe different types of errors or scenarios but do not specifically relate to a name error.