Skip to main contentSkip to solution

Match List-I with List-II

List-I ExceptionList-II Description
(A) EOFError(I) It is raised when mismatched or inappropriate values.
(B) NameError(II) It is raised when an operator is supplied with a value of the incorrect data type.
(C) ValueError(III) It is raised when the end of file condition is reached.
(D) TypeError(IV) It is raised when a local or global variable name is not defined.

Solution

✅ Correct Option: 2
List IList II
(A) EOFError(III) Raised when the end of file condition is reached
(B) NameError(IV) Raised when a local or global variable name is not defined
(C) ValueError(I) Raised when mismatched or inappropriate values are given
(D) TypeError(II) Raised when an operator is supplied with a value of the incorrect data type

ValueError is about the right type but a wrong value, e.g. int("abc")\texttt{int("abc")}. TypeError is about the wrong type itself, e.g. "a" + 5\texttt{"a" + 5}.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question