I have a very simple function which summarize the list elements without using sum
function or looping technique. Here it is:
def find_sum(mylist):
def get_value(sublist, counter):
counter += sublist.pop()
if sublist:
get_value(sublist, counter)
else:
print counter # It will print correct result
return counter
my_sum = get_value(mylist, 0) # But my_sum is None
return my_sum
Why the emdedded function returns None?