Why in this code:--
def factorial(n):
if n <1: # base case
return 1
else:
return n * factorial( n - 1 ) # recursive call
print factorial(4)
I have error:
File "__main__", line 8
print factorial(4)
SyntaxError: invalid syntax
I want to do factorial recursive
You received this message because you are subscribed to the Google Groups "brython" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brython+unsubscribe@googlegroups.com.
To post to this group, send email to bry...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brython/4f036755-efe4-4f10-ad46-5c739fe7eb00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.