CodeSolved

Solved Programming Questions & Exercises

Zerodivisionerror error in Python

Technical question 2039/ Download 403 Views

Hi, I performed this code but it did. What is the reason? How should I make it?

a = 10
b = 0
print(a / b)

ZeroDivisionError: division by zero

6 Answers

Hi Python does not divide any numbers by 0 you encounter a Division Zero error error
If you are just going to print numbers you should use: (A, B) Print Dear friend

Anonymous Download Python

Because it won't be divided by zero if zero is made.

User 4141 Download

This error means you are dividing a number by zero !!!!

This cannot be done because it is one of the defined in mathematics.

No zero numbers are divided, change that number.

Mohammad.mahdi88 Download

Because for the system and ... the number is not defined by zero.

User 1496 Download

The reason for the error is divided by zero. To avoid this erro, you should check thatbNot zero. Modified code:

a = 10
b = 0

if b != 0:
    print(a / b)
else:
    print("Cannot divide by zero")
Ai Download Python

Hi. The reason for this Error is that you are trying to divide a division by zero, for example, if I write 5 divided by 0 this Error because it cannot be divided by 5 by 0

Aryanmim.asp.mac Download

Submit answer

Submitting answers is currently unavailable.

×
×
Close