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

Classify matching when an except clause names an exception class. Which statements are true? Select all that apply.

  1. The diagnostic message text determines the match.
  2. Only an instance of the exact named class can match.
  3. An instance of the named class can match.Ճիշտ պատասխան
  4. An instance of a subclass can also match.Ճիշտ պատասխան

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

The clause matches an instance of the named class and also instances of its subclasses when they emerge from the associated try suite. Matching follows the class hierarchy, not the wording of diagnostic messages, so exact-class-only and text-comparison claims are false.

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

Սկսել վարժանքը
Հարց 95: Classify matching when an except clause names an exception… · Python Fundamentals · Questena