1. Home
  2. Data Science
  3. Python
  4. What exception is raised by int('abc') in Python?

Added 25 Nov 2026

What exception is raised by int('abc') in Python?

  1. TypeError
  2. KeyError
  3. ValueError Correct answer
  4. NameError

Correct answer

C. ValueError

5 views

MCQSEXAM

Explanation

The string cannot be parsed, so ValueError is raised.

Reference

Asked in: Python Interview Exception Handling

https://docs.python.org/3/tutorial/errors.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs