[Tutor] recursion surprise

Jim Mooney cybervigilante at gmail.com
Sun Jun 9 01:52:18 CEST 2013


On 8 June 2013 16:46, Dave Angel <davea at davea.name> wrote:
> On 06/08/2013 07:12 PM, Jim Mooney wrote:
>>
>> On 8 June 2013 15:43, Dave Angel <davea at davea.name> wrote:
> Did you even read my message?  Or Mark's?  Or look at the code I posted?
> You are missing a return statement at the end of the function, so after the
> assignment  num=addone(num+1) it will return None, by definition.

Well, I thought

    if num > 10:
        return num

Was a return statement. Num does become > 10.   You mean I need more than one?

Jim


More information about the Tutor mailing list