I am trying to implement the function below into one line of lambda code.
def fac(num):
num = int(num)
if num > 1:
return num * fac(num - 1)
else:
return 1
I have constructed a lambda statement, but I keep getting syntax error:
z = lambda z: if (z > 1) z * (z-1) else 1