MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / factorial

Function factorial

projects/Calculator/main.py:55–65  ·  view source on GitHub ↗

Function to calculate the factorial of a number. Takes a number as an argument, calculates the factorial of the number, and returns the result.

(num)

Source from the content-addressed store, hash-verified

53
54
55def factorial(num):
56 """
57 Function to calculate the factorial of a number.
58
59 Takes a number as an argument, calculates the factorial of the number,
60 and returns the result.
61 """
62 answer = 1
63 for i in range(num):
64 answer *= i + 1
65 return answer
66
67
68def complex_arithmetic():

Callers 2

binomialFunction · 0.85
main.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected