-
-
Notifications
You must be signed in to change notification settings - Fork 49.1k
Open
Labels
enhancementThis PR modified some existing filesThis PR modified some existing files
Description
Feature description
Currently, the divide_numbers(a, b) function in maths/division.py performs basic division but lacks input validation for zero denominators.
While Python’s built-in behavior raises a ZeroDivisionError, adding explicit validation would make the function more robust and user-friendly — especially for beginners using this repository to learn algorithms.
This feature would ensure that the function provides clearer feedback and better error handling, aligning with educational best practices
def divide_numbers(a, b):
if b == 0:
raise ValueError("Cannot divide by zero. Please provide a non-zero denominator.")
return a / b
Metadata
Metadata
Assignees
Labels
enhancementThis PR modified some existing filesThis PR modified some existing files