Back to Python Errors
Python Exception

ZeroDivisionError

Division by zero

What does this error mean?

Occurs when trying to divide a number by zero.

How to fix ZeroDivisionError?

Add a check to ensure the divisor is not zero before dividing.

Example
5 / 0 # ZeroDivisionError: division by zero