Skip to content

namans895/Recursive-Factorial-Program

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔁 Recursive Factorial Calculator using Python

📌 Project Overview

This project demonstrates how recursion works in Python by calculating the factorial of a number. It is designed as a beginner-friendly project that helps understand recursive functions, base cases, and user input handling.


📖 What is Recursion?

Recursion is a programming technique in which a function calls itself to solve a problem.

Every recursive function contains:

  • Base Case
  • Recursive Case

Without a base case, recursion will continue indefinitely and eventually cause an error.


📚 What is Factorial?

The factorial of a non-negative integer is the product of all positive integers less than or equal to that number.

Example:

5! = 5 × 4 × 3 × 2 × 1 = 120

Special Cases:

0! = 1
1! = 1

🧮 Mathematical Formula

n! = n × (n−1)!

Base Case

0! = 1

✨ Features

  • Recursive implementation
  • User input support
  • Input validation
  • Well-documented code
  • Beginner-friendly
  • Modular design

📂 Project Files

Recursive-Factorial-Calculator/
│
├── recursive_factorial.py
├── Recursive_Factorial.ipynb
├── README.md
├── LICENSE
├── requirements.txt
└── screenshots/

▶️ How to Run

Clone the repository

git clone https://github.com/YourUsername/Recursive-Factorial-Calculator.git

Move to the project folder

cd Recursive-Factorial-Calculator

Run

python3 recursive_factorial.py

💻 Sample Output

=============================================
      Recursive Factorial Calculator
=============================================

Enter a non-negative integer: 5

Result
---------------------------------------------
Factorial of 5 = 120

🛠 Technologies Used

  • Python 3
  • VS Code
  • Jupyter Notebook
  • Git
  • GitHub

📚 Concepts Used

  • Functions
  • Recursion
  • Base Case
  • User Input
  • Exception Handling
  • Code Reusability

🚀 Future Improvements

  • GUI using Tkinter
  • Animation of recursion
  • Performance comparison with iteration
  • Export results
  • Multiple mathematical functions

👨‍💻 Author

Naman Sharma

B.Tech Student

Python Programming Project


📄 License

This project is created for educational and learning purposes.

About

A Python project demonstrating recursion by calculating the factorial of a number with proper input validation, modular function design, and clear documentation.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages