Files
grokking-algorithms/chapter_03/recursion.py
T
onyx_online 4cd7bb7d18 reorganise directories
upd chapter_01/binary.py
2025-03-26 01:27:35 +00:00

8 lines
159 B
Python

def factorial(x):
if x == 1: # This is the base case
return 1
return x * factorial(x - 1) # This is the recursive case
print(factorial(4))