1 def fact(j): 2 sum = 0 3 if j == 0: 4 sum = 1 5 else: 6 sum = j * fact(j-1) 7 return sum 8 print(fact(5))
1 def Factorial(n): 2 if n == 1: 3 fn = 1 4 else: 5 fn = n*Factorial(n-1) 6 return fn 7 print(Factorial(5))