[EMAIL PROTECTED] wrote: > #include <stdio.h> > #include <stdlib.h> > > 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? >
Why not? What did you expect? Hint: The first two lines are comments to Python -- so are ignored. The last two lines just print a string -- no problem there. The recursive calculation is standard -- the extra set of parenthesis in the if don't cause any problem. So again please: Why are you surprised? Gary Herron -- http://mail.python.org/mailman/listinfo/python-list