From c9ff050d0707ae47240f23854574da80f6ba7e04 Mon Sep 17 00:00:00 2001 From: Derderderr Date: Sat, 14 Feb 2026 12:37:11 +0800 Subject: [PATCH 1/2] Update Multiply.py --- Multiply.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Multiply.py b/Multiply.py index c8e1b52228f..7268c3fc8cd 100644 --- a/Multiply.py +++ b/Multiply.py @@ -1,4 +1,7 @@ def product(a, b): + if b < 0: + return -product(a, -b) + if a < b: return product(b, a) elif b != 0: @@ -9,4 +12,4 @@ def product(a, b): a = int(input("Enter first number: ")) b = int(input("Enter second number: ")) -print("Product is: ", product(a, b)) +print("Product is:", product(a, b)) From 028e1b7cd21eedeed7b14cce950be9f2d0914b92 Mon Sep 17 00:00:00 2001 From: Derderderr Date: Sat, 14 Feb 2026 12:44:50 +0800 Subject: [PATCH 2/2] Update Multiply.py --- Multiply.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Multiply.py b/Multiply.py index 7268c3fc8cd..7565ddbc838 100644 --- a/Multiply.py +++ b/Multiply.py @@ -1,6 +1,6 @@ def product(a, b): if b < 0: - return -product(a, -b) + return -1 * product(a, -b) if a < b: return product(b, a)