From 83f41c0ecd44df1d9f61598d606c8bb9915073b2 Mon Sep 17 00:00:00 2001 From: Partha Kalita Date: Mon, 29 Jul 2024 11:47:28 +0200 Subject: [PATCH] Your commit message --- src/utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/utils.py b/src/utils.py index faae9e3..d5e88b4 100644 --- a/src/utils.py +++ b/src/utils.py @@ -41,8 +41,12 @@ def divide(a: float, b: float) -> float: Returns: float ''' - return a / b - + try: + return a / b + except ZeroDivisionError: + print("Error: Division by zero is not allowed.") + return None + def modulo(a: int, b: int): ''' ...