Sunday, November 17, 2024
Google search engine
HomeLanguagesZeroDivisionError: float division by zero in Python

ZeroDivisionError: float division by zero in Python

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.

Python3

a=20
b=0
print(a/b)
Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments