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
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