In this article, we will see what is ZeroDivisionError and also different ways to fix this error.
What is ZeroDivisionError?
A ZeroDivisionError in Python occurs when we try to divide a number by 0. We can’t divide a number by 0 otherwise it will raise an error. Let us understand it with the help of an example. In this example, we are dividing a number from 0 and we can see that it raises a ZeroDivisionError.
a=20
b=0
print(a/b)