I came across this python snippet recently and can someone tell me what does the for loop in the return statement do?
def dec(num, num_dig):
if num_dig==0:
return int(num==1)
else:
return sum(dec(num/i, num_dig-1) for i in range(1,10) if num/i*i==num)
Apparently, the question was about finding the no. of x-digit numbers whose product equals N. Thanks, in advance