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

What happens to both 5 / 0 and 5 // 0?

  1. True division returns infinity; floor division returns zero.
  2. Both raise ZeroDivisionError.Ճիշտ պատասխան
  3. Only true division raises an exception.
  4. Only floor division raises an exception.

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

True division and floor division both reject a numeric zero divisor by raising ZeroDivisionError. Floor division does not return zero, and true division does not substitute an infinity value.

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

Սկսել վարժանքը
Հարց 114: What happens to both 5 / 0 and 5 // 0? · Python Fundamentals · Questena