It is my intention to recursively multiply two numbers with this function. I realize this is quite possibly far from optimal. Why does my call, print rec_mult(15, 1111), to this function print None rather than 16665?
def rec_mult(x, y, tot=0, inc=0):
if int(x) == 0:
return tot
else:
x = str(x)
tot += int(x[(-1+inc):]) * y
x = x[:(-1+inc)] + "0"; inc -= 1
rec_mult(x, y, tot, inc)