def long_division(dividend,divisor,times = 0): if(dividend - (divisor * times) < divisor ): return dividend - (divisor * times) else: return long_division(dividend,divisor,times + 1) print(long_division(100,6)) # >> 4