Skip to content

Commit f673191

Browse files
authored
Fix
1 parent 5b086f7 commit f673191

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Multiply.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
def product(a, b):
2+
# Handle negative values
3+
if b < 0:
4+
return -product(a, -b)
5+
26
if a < b:
37
return product(b, a)
48
elif b != 0:
@@ -9,4 +13,4 @@ def product(a, b):
913

1014
a = int(input("Enter first number: "))
1115
b = int(input("Enter second number: "))
12-
print("Product is: ", product(a, b))
16+
print("Product is:", product(a, b))

0 commit comments

Comments
 (0)