any change you want to have :

"return add(x,y)" in the else ?


[EMAIL PROTECTED] wrote:
> There is problaly a really simple answer to this, but why does this
> function print the correct result but return "None":
>
> def add(x, y):
>     if x == 0:
>         print y
>         return y
>     else:
>         x -= 1
>         y += 1
>         add(x, y)
> 
> print add(2, 4)
> 
> result:
> 6
> None
> 
> Martin

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

Reply via email to