This repository contains Python practice exercises organized by topic.
The goal is to improve skills step by step through algorithms, OOP, async programming, refactoring, and more.
CODING_PRACTICE/
βββ algorithm_challenges/ β coding challenge solutions
βββ asyncio_sysprogram/ β async & system programming practice
βββ datastructs_algorithms/ β data structures & algorithms
βββ funcs_itertools/ β functions & itertools exercises
βββ internals_bestpractices/ β Python internals & best practices
βββ miniprojs/ β mini projects
βββ oop/ β object-oriented programming exercises
βββ python_fundamentals/ β basics & foundations
βββ refactoring/ β refactoring exercises
βββ test_performance/ β performance testing & benchmarking
βββ .venv/ β virtual environment
βββ .gitignore
βββ pyproject.toml β Black & Ruff configuration
βββ requirements.txt β dependencies
βββ README.md β this file
-
Clone the repo
git clone https://github.com/sahancodes/pythonpractice.git
cd pythonpractice -
Create a virtual environment
python -m venv .venv -
Activate it
- Windows (PowerShell): .\.venv\Scripts\Activate.ps1
- macOS/Linux: source .venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
Each folder contains focused exercises or projects. For example:
Run a script:
python python_fundamentals/example.py
Run tests:
pytest algorithm_challenges
- Python 3.x
- pytest β for testing
- Black β code formatter
- Ruff β fast linter
- Practice Python across different areas (fundamentals β advanced).
- Build reusable code and mini projects.
- Learn clean coding practices with tests, linting, and formatting.
- Explore performance testing, async, and Python internals.
- Add more exercises regularly.
- Expand
miniprojs/
into larger applications. - Continue experimenting with new Python features.
π¨βπ» Author: @sahancodes """
output_path = "/mnt/data/README.md" with open(output_path, "w", encoding="utf-8") as f: f.write(readme_md)
output_path