QuestenaPráctica que te muestra qué repasar después
Pregunta 94

Which exception type results from evaluating 7 % 0?

  1. ValueError
  2. ZeroDivisionErrorRespuesta correcta
  3. TypeError
  4. It returns 0

Explicación

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.

Continúa con este test

Empezar la práctica
Pregunta 94: Which exception type results from evaluating 7 % 0? · Python Fundamentals · Questena