Question 2 of 8intermediate💡 UnderstandShort Answer4 marks
When are the following built-in exceptions raised? Give examples to support your answers.
(a)
ImportError
(b)
IOError
(c)
NameError
(d)
ZeroDivisionError
Explanation
The context explicitly defines IOError as being raised when a file cannot be opened and mentions ZeroDivisionError and NameError as built-in exceptions. The context also references 'division by zero' as an example of an exception. ImportError is mentioned in the exercise question but not explicitly defined in the provided context chunks.