Recursive Multiplication Design a recursive function that accepts two arguments into the parameters x and y. The function should return the value of x times y. Remember, multiplication can be performed as repeated addition as follows: 7 × 4 = 4 + 4 + 4 + 4 + 4 + 4 + 4
Yes, this is my home work from like three weeks ago, but i just cant figure this thing out.
def mult(x, y):
x = int(input("enter x"))
y = int(input("enter y"))
i = 0
for i in range(y):
x = x + (x - 1)
i = i + 1
print(x)
mult(x, y)
This is what i have, but if i put 10 for x and 10 for y i get 1024 instead of 100. what is going on here?