pratik-choudhari / AlgoCode

Welcome everyone!🌟 Here you can solve problems, build scrappers and much moreπŸ’»
https://github.com/pratik-choudhari/AlgoCode
MIT License
131 stars 166 forks source link

Code crashing when divide by 0 #479

Closed rodrigo-br closed 3 years ago

rodrigo-br commented 3 years ago

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

pratik-choudhari commented 3 years ago

@rodrigo-br Great, can you make a PR?

rodrigo-br commented 3 years ago

@pratik-choudhari done! Is my first PR so if theres something wrong, please let me know.