Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/codemistic/Data-Structures-and-Algorithms
/ fact
Function
fact
Python/factorial.py:8–12 ·
view source on GitHub ↗
(n)
Source
from the content-addressed store, hash-verified
6
7
''
&
#x27;
8
def
fact(n):
9
ans = 1
10
for
i in range(2, n+1):
11
ans *= i
12
return
ans
13
n=int(input(
"Enter the number "
))
14
f=fact(n)
15
print(
"Factorial of {} is {}"
.format(n,f))
Callers
1
factorial.py
File · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected