Files
grokking_algorithms/03_recursion/python/03_factorial.py
Aditya Bhargava 8cf108a20c code for chapter 3
2016-03-02 14:15:37 -08:00

8 lines
87 B
Python

def fact(x):
if x == 1:
return 1
else:
return x * fact(x-1)
print fact(5)