I'm a newbie to Python, with a Java background. I came across the following function definition
def S(seq,i=0):
print i
if i==len(seq):
return 0
return S(seq,i+1)+seq[i]
What exactly does the i=0
do here, is it re-initialised to 0 each time? Because I notice that the value of i is incremented .