Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ZiniuLu/Python-100-Days
/ factorial
Function
factorial
Day01-15/Day06/function1.py:13–17 ·
view source on GitHub ↗
(n)
Source
from the content-addressed store, hash-verified
11
12
# 将求阶乘的功能封装成一个函数
13
def
factorial(n):
14
result = 1
15
for
num in range(1, n + 1):
16
result *= num
17
return
result
18
19
20
print(factorial(7) // factorial(3) // factorial(4))
Callers
1
function1.py
File · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected