Question
"Every syntax error is an exception but every exception cannot be a syntax error." Justify the statement.
Solution
β Verified
"Every syntax error is an exception, but not every exception is a syntax error."
Syntax errors happen when the code structure is wrong (e.g., missing :) β they are exceptions raised before execution.
Other exceptions(like ZeroDivisionError, ValueError, etc.) occur during program execution, even if the syntax is correct.
Click here to download practice questions on
Exception Handling in Python