Skip to content

A Python script that calculates the factorial of a non-negative integer.

License

Notifications You must be signed in to change notification settings

abdullahguch/factorial-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Factorial Calculator

A simple Python script that calculates the factorial of a non-negative integer.

Table of Contents

Introduction

This Python script provides a function to calculate the factorial of a non-negative integer. Factorial is defined as the product of all positive integers from 1 to the given integer.

Example:

  • Factorial of 5 (written as 5!) is 5 x 4 x 3 x 2 x 1 = 120.

Usage

To use the factorial calculator, simply call the factorial function with a non-negative integer as an argument. Here's an example of how to use it in your Python code:

from factorial_calculator import factorial

num = 5
result = factorial(num)
print(f"The factorial of {num} is {result}")

Getting Started

Follow these steps to get started with the Python Factorial Calculator:

  1. Clone this repository to your local machine:

git clone https://github.com/abdullahguch/factorial-calculator.git

  1. Install Python (if not already installed). You can download it from python.org.

  2. Navigate to the project directory:

cd python-factorial-calculator

  1. Run the script to calculate the factorial:

python factorial_calculator.py

  1. Follow the on-screen instructions to enter a non-negative integer and see the factorial result.

Contributing

Contributions are welcome! If you have any suggestions, bug reports, or would like to contribute new features, please follow these steps:

  1. Fork the repository.

  2. Create a new branch for your feature or bug fix:

git checkout -b feature-name

  1. Make your changes and commit them:

git commit -m "Add your feature or bug fix description"

  1. Push your changes to your fork:

git push origin feature-name

  1. Create a pull request on the original repository.

Remember to replace "feature-name" with a descriptive branch name when creating contributions.

License

This project is licensed under the MIT License, which allows you to use, modify, and distribute the code for both personal and commercial purposes. See the LICENSE file for more details.

About

A Python script that calculates the factorial of a non-negative integer.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages