Q: Which of the following is not a standard exception in Python?
Solution: NameError, IOError and ValueError are standard exceptions in Python whereas Assignment error is not a standard exception in Python.
Q: Syntax errors are also known as parsing errors.
Solution: Syntax errors are known as parsing errors. Syntax errors are raised when there is a deviation from the rules of a language. Hence the statement is true.
Q: An exception is ____________
Solution: An exception is an object that is raised by a function signaling that an unexpected situation has occurred, that the function itself cannot handle.
Q: _______________________ exceptions are raised as a result of an error in opening a particular file.
Solution: IOError exceptions are raised as a result of an error in opening or closing a particular file.
Q: Which of the following blocks will be executed whether an exception is thrown or not?
Solution: The statements in the finally block will always be executed, whether an exception is thrown or not. This clause is used to close the resources used in a code.
You Have Score    | /5 |