Skip to main contentSkip to solution

Match List-I with List-II

List-IList-II
(A) NameError(I) raised when a built-in method receives an argument that has the right data type but mismatched values.
(B) IndexError(II) raised when an operator is supplied with a value of incorrect data type.
(C) TypeError(III) raised when subscript in a sequence is out of range.
(D) ValueError(IV) raised when a local or global variable name is not defined.

Solution

✅ Correct Option: 2
List IList II
(A) NameError(IV) Raised when a local or global variable name is not defined
(B) IndexError(III) Raised when a subscript in a sequence is out of range
(C) TypeError(II) Raised when an operator is supplied with a value of incorrect data type
(D) ValueError(I) Raised when a built-in method receives an argument of the right data type but an inappropriate value

TypeError is about the wrong type, as in "a" + 5. ValueError is about the right type with a bad value, as in int("abc").

Keyboard Shortcuts

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