MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / factorial

Function factorial

project_euler/problem_020/sol1.py:13–18  ·  view source on GitHub ↗

Find the factorial of a given number n

(num: int)

Source from the content-addressed store, hash-verified

11
12
13def factorial(num: int) -> int:
14 """Find the factorial of a given number n"""
15 fact = 1
16 for i in range(1, num + 1):
17 fact *= i
18 return fact
19
20
21def split_and_add(number: int) -> int:

Callers 1

solutionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected