Skip to content

Commit c9ff050

Browse files
authored
Update Multiply.py
1 parent 85cc5bc commit c9ff050

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Multiply.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
def product(a, b):
2+
if b < 0:
3+
return -product(a, -b)
4+
25
if a < b:
36
return product(b, a)
47
elif b != 0:
@@ -9,4 +12,4 @@ def product(a, b):
912

1013
a = int(input("Enter first number: "))
1114
b = int(input("Enter second number: "))
12-
print("Product is: ", product(a, b))
15+
print("Product is:", product(a, b))

0 commit comments

Comments
 (0)