KnowledgeBoat Logo

Computer Science

Differentiate between a syntax error and a logical error in a python program. When is each type of error likely to be found?

Python Data Handling

73 Likes

Answer

Syntax ErrorLogical Error
Syntax Errors occur when we violate the rules of writing the statements of the programming language.Logical Errors occur due to our mistakes in programming logic.
Program fails to compile and execute.Program compiles and executes but doesn't give the desired output.
Syntax Errors are caught by the compiler.Logical errors need to be found and corrected by people working on the program.

Syntax errors are found at compile type whereas Logical errors are found when the program starts executing.

Answered By

36 Likes


Related Questions