Match List-I with List-II
List-I List-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.
Match List-I with List-II
| List-I | List-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 I | List 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").
Related questions:
2026: 24 May Shift 1
2025: 15 May Shift 2