I am new to python and I am having a problem. I want to write a recursive function that takes two inputs (integers) and subtracts the second from the first, until the first is less than the second, and calculates the # of time it subtracts before being less.
This is what I have so far, but I am having problems getting the function to repeat the subtraction of the second from the first;
def div(first,sec):
if first > sec:
return div((first - sec),sec) + first
else:
return 0
1 Answer