Chapters
Python114 chapters

ReferenceException types

ZeroDivisionError

Divided, floor-divided or taken a remainder by zero.

Signature

ZeroDivisionError(message)

Returns

Raised by /, // and %.

Example

Python
try:
    10 / 0
except ZeroDivisionError as problem:
    print("ZeroDivisionError:", problem)

Output

ZeroDivisionError: division by zero

See also