Skip to content

Banisha19/Basic-python-programs

 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%