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

Which exception type results from evaluating 7 % 0?

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

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

Modulo by numeric zero has no defined finite result in Python, so the operation raises ZeroDivisionError. Returning zero would confuse a zero remainder with an invalid zero divisor.

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

Սկսել վարժանքը
Հարց 94: Which exception type results from evaluating 7 % 0? · Python Fundamentals · Questena