12 lines
229 B
Python
12 lines
229 B
Python
def product(n,m):
|
|
temp = 0
|
|
while m != 0:
|
|
if m > 0:
|
|
temp = temp + n
|
|
else:
|
|
temp = temp - n
|
|
if m > 0:
|
|
m = m - 1
|
|
else:
|
|
m = m + 1
|
|
return temp
|