Skip to main contentSkip to solution

Name the built in exception raised when an operator is supplied with a value of incorrect data type.

Solution

✅ Correct Option: 3

TypeError is raised when an operator or function is applied to an object of the wrong data type, for example "5" + 2\texttt{"5" + 2} (adding a string to an integer).


ValueError: the data type is correct but the value is not acceptable, for example int("abc")\texttt{int("abc")}.

NameError: raised when a variable or function name is used before it is defined.

IOError: raised when an input/output operation such as opening a file fails.

Keyboard Shortcuts

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