Poopoopeepe

Recursion using python

Nov 15th, 2023
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.11 KB | Source Code | 0 0
  1. def factorial(n):
  2.     if n == 0 or n == 1:
  3.         return 1
  4.     else:
  5.         return n * factorial(n - 1)
  6.  
Advertisement
Add Comment
Please, Sign In to add comment