It's just something to atempt it. When user input a 0 and ask for a division, it return an error.
Example
def _div(left: int, right: int) -> int:
return left / right
if left == 0 or right == 0: # This is an important thing too, so the the code don't outcome an error
print('Unable to divide by zero')
else:
return left / righ
Checklist:
[x] I have read the project guidelines.
[x] I have checked all the existing projects, before submitting a new project issue.
[x] This issue will be meaningful for the project.
Bug π
Description
It's just something to atempt it. When user input a 0 and ask for a division, it return an error.
Example
def _div(left: int, right: int) -> int: return left / right if left == 0 or right == 0: # This is an important thing too, so the the code don't outcome an error print('Unable to divide by zero') else: return left / righ
Checklist:
in a Python calculator code