Skip to main contentSkip to solution

Match List-I with List-II

List-IList-II
(A) ImportError(I) When an operator is supplied with a value of incorrect data type.
(B) IOError(II) When the requested module defintion is not found.
(C) ValueError(III) When the file specified in a program cannot be opened.
(D) TypeError(IV) When an operation receives an argument having right data type but mismatched values.

Solution

✅ Correct Option: 2
List IList II
(A) ImportError(II) When the requested module definition is not found.
(B) IOError(III) When the file specified in a program cannot be opened.
(C) ValueError(IV) When an operation receives an argument having right data type but mismatched values.
(D) TypeError(I) When an operator is supplied with a value of incorrect data type.

ValueError and TypeError are easily swapped. Remember: TypeError means the wrong type (e.g. 5+"a"5 + \text{"a"}), while ValueError means the right type but an unacceptable value (e.g. int("abc")\text{int("abc")}).

Keyboard Shortcuts

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