n00m wrote:
> def f(i,sm):
>     if i+1==len(a):
>         print sm+a[i]
>         return sm+a[i]
>     else:
>         f(i+1,sm+a[i])
> 
> a=[1,2,3,4,5]
> 
> print f(0,0)
> 
> 
> 15
> None

You're not actually returning anything from
the recursive call.

TJG
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to