70.6k views
4 votes
When an exception is thrown, Python creates an exception object that contains all but one of the following items of information. Which one is it?

A. The type of exception.
B. The name of the class for the type of exception.
C. The severity of the exception.
D. The message for the exception.

User Jarlh
by
7.3k points

1 Answer

6 votes

Final answer:

When an exception is thrown in Python, it creates an exception object that contains information such as the type of exception, the name of the class for the type of exception, and the message for the exception.

Step-by-step explanation:

When an exception is thrown in Python, it creates an exception object that contains all but one of the following items of information:

  1. The type of exception.
  2. The name of the class for the type of exception.
  3. The severity of the exception.

The severity of the exception is not included in the exception object. However, it can be inferred from the specific type of exception or the circumstances in which the exception occurred. The message for the exception is also included in the exception object and provides additional information about the specific error or problem that caused the exception to be raised.

User Kuslahne
by
7.2k points