QuestenaՎարժանք, որը ցույց է տալիս՝ ինչ կրկնել հաջորդիվ
Հարց 90

Which exception type is raised by int("abc")?

  1. TypeError
  2. ValueErrorՃիշտ պատասխան
  3. NameError
  4. It returns 0

Բացատրություն

The converter accepts a string as an input type, but these characters do not represent a valid base-ten integer, so ValueError fits. TypeError would describe an unsuitable input type rather than unsuitable content within an accepted type.

Շարունակեք այս թեստով

Սկսել վարժանքը
Հարց 90: Which exception type is raised by int("abc")? · Python Fundamentals · Questena