MCPcopy Create free account
hub / github.com/BeeBombshell/Python-DSA / fact

Function fact

Recursion/Factorial_Recursion.py:1–5  ·  view source on GitHub ↗
(n = 5)

Source from the content-addressed store, hash-verified

1def fact(n = 5):
2 if n < 2:
3 return 1
4 else:
5 return n * fact(n-1)
6num = input("Enter a number to get its factorial: ")
7if num == 'None' or num == '' or num == ' ':
8 print("Factorial of default value is: ",fact())

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected