hey guys, can anybodyhelp me on this one?
this is my code, but i guess im on the wrong way ..
the error message im receiving is:
Traceback (most recent call last):
File "python", line 8, in
File "python", line 4, in factorial
File "python", line 6, in factorial
UnboundLocalError: local variable 'fac' referenced before assignment
def factorial(x): if x > 0: for n in range(x): fac = x * factorial(n) return fac print fac print factorial(4)