Skip to content

Latest commit

 

History

History
70 lines (50 loc) · 1.37 KB

File metadata and controls

70 lines (50 loc) · 1.37 KB

Basic Python Programs

A collection of basic Python programs for learning and reference.

Programs Included

1. Factorial Calculator (factorial.py)

Calculates the factorial of a given number using both iterative and recursive approaches.

Usage:

python factorial.py

Features:

  • Iterative factorial calculation
  • Recursive factorial calculation
  • Input validation and error handling
  • Interactive command-line interface

Getting Started

Prerequisites

  • Python 3.x

Installation

  1. Clone the repository:
git clone https://github.com/Sbiswas001/Basic-python-programs.git
cd Basic-python-programs
  1. (Optional) Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies (if any):
pip install -r requirements.txt

Running the Programs

Each program can be run independently:

python factorial.py

Project Structure

Basic-python-programs/
│
├── README.md           # Project documentation
├── requirements.txt    # Python dependencies
├── .gitignore         # Git ignore rules
└── factorial.py       # Factorial calculator program

Contributing

Feel free to add more basic Python programs to this repository!

License

This project is open source and available for educational purposes.