Python Part 1 Predefined Exception Class Listed Describe Reasons Exception Triggered Excep Q37169381

python:

part 1:

For each of the predefined exception class listed below,describe for what reasons the

exception is triggered.

Exception Description

AssertionError          Raisedwhen the condition is false.

ZeroDivisionError       Raisedwhen a number is modulo zero or is divided by zero.

NameError          Raisedwhen a local or global name is not found.

MemoryError      Raisedwhen an operation runs out of memory.

ValueError         Raisedwhen an operation or function receives an argument that has

the right type but an inappropriate value.

IndexError Raised whenever attempting to accessan index that is outside the

bounds of a list.

KeyError Raised when the key is not found inthe dictionary.

ImportError Raised when an import statementfails to find the module definition

or when a from… import fails to find a

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.