Skip to content

Instantly share code, notes, and snippets.

View DNXEMPIRE-1's full-sized avatar
:octocat:
Code Ninja

Dennis Nzioki DNXEMPIRE-1

:octocat:
Code Ninja
View GitHub Profile
@DNXEMPIRE-1
DNXEMPIRE-1 / factorial.py
Last active March 11, 2024 19:05
Gist - code snippet written in Python.A function that calculates the factorial of a given number:
def factorial(n):
"""
Calculate the factorial of a non-negative integer.
Args:
n (int): The non-negative integer whose factorial is to be calculated.
Returns:
int: The factorial of the input integer.
"""