Re: Recursive function won't compile

2008-04-02 Thread Keith Thompson
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: >> #include >> #include >> >> def RecursiveFact(n): >> if(n>1): >> return n*RecursiveFact(n-1) >> else: >> return 1 >> >> fact = RecursiveFact(31) >> print fact >> >> fact = "End of program" >> print fact >> >> >> ..but y

Re: Recursive function won't compile

2008-04-02 Thread George Sakkis
On Apr 2, 5:00 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > > > #include > > #include > > > def RecursiveFact(n): > > if(n>1): > > return n*RecursiveFact(n-1) > > else: > > return 1 > > > fact = RecursiveFact(31) > > print fact > > >

Re: Recursive function won't compile

2008-04-02 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > #include > #include > > def RecursiveFact(n): > if(n>1): > return n*RecursiveFact(n-1) > else: > return 1 > > fact = RecursiveFact(31) > print fact > > fact = "End of program" > print fact > > > ..but yet it still gives the right answe

Re: Recursive function won't compile

2008-04-02 Thread dj3vande
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: (Subject: Recursive function won't compile) >#include >#include > >def RecursiveFact(n): >..but yet it still gives the right answer. How is this possible? Possibly because it gives the right ans

Re: Recursive function won't compile

2008-04-02 Thread ajaksu
On Apr 2, 5:23 pm, [EMAIL PROTECTED] wrote: > #include > #include > > def RecursiveFact(n): >     if(n>1): >         return n*RecursiveFact(n-1) >     else: >         return 1 > > fact = RecursiveFact(31) > print fact The output is 822283865417792281772556288000 and is correct. But the "#incl

Re: Recursive function won't compile

2008-04-02 Thread Gary Herron
[EMAIL PROTECTED] wrote: > #include > #include > > def RecursiveFact(n): > if(n>1): > return n*RecursiveFact(n-1) > else: > return 1 > > fact = RecursiveFact(31) > print fact > > fact = "End of program" > print fact > > > ..but yet it still gives the right answer. How

Recursive function won't compile

2008-04-02 Thread bc1891
#include #include def RecursiveFact(n): if(n>1): return n*RecursiveFact(n-1) else: return 1 fact = RecursiveFact(31) print fact fact = "End of program" print fact ..but yet it still gives the right answer. How is this possible? -- http://mail.python.org/mailman/l