A collection of Python examples and exercises, from basics to advanced topics like LLMs and web APIs.
| Level | Topics |
|---|---|
| Beginner | Variables, Data Types, Operators, Input/Output |
| Intermediate | Control Flow, Functions, Data Structures, File Handling |
| Advanced | OOP, Error Handling, Modules, Lambda Functions |
| Expert | Web APIs (FastAPI, Flask), LLM Architecture, Fine-tuning |
python-learning/
├── basics/ # Python fundamentals - start here
│ ├── 01_introduction/ # Hello World, user input
│ ├── 02_variables_types/ # Variables, operators, type conversion
│ ├── 03_control_flow/ # If/else, loops, patterns
│ ├── 04_functions/ # Functions, recursion
│ ├── 05_data_structures/ # Lists, tuples, sets, dictionaries
│ ├── 06_strings/ # String operations
│ ├── 07_file_handling/ # File I/O
│ ├── 08_oop/ # Object-Oriented Programming
│ ├── 09_error_handling/ # Exceptions, try/except
│ ├── 10_advanced/ # Lambda, modules, decorators
│ ├── 11_projects/ # Games to build
│ └── 12_web/ # Flask introduction
│
├── fastapi/ # REST APIs with FastAPI
├── rest_api/ # Flask + SQLAlchemy APIs
├── llm_fundamentals/ # Build LLMs from scratch
│ ├── architecture/ # Transformer implementation
│ ├── pre_training/ # Model training
│ ├── fine_tuning/ # Fine-tuning techniques
│ └── weight_loading/ # Load pre-trained models
│
├── data/ # Datasets
└── requirements.txt # Dependencies
Download Python 3.10 or higher from python.org
git clone <your-repo-url>
cd pythonFor basics, no installation needed. For web APIs and LLMs:
pip install -r requirements.txtcd basics/01_introduction
python 01_hello_world.py| Week | Folder | Practice Projects |
|---|---|---|
| 1 | 01_introduction → 03_control_flow |
Calculator, Number Guesser |
| 2 | 04_functions → 06_strings |
Text Analyzer, Mad Libs |
| 3 | 05_data_structures → 07_file_handling |
To-Do List, File Organizer |
| 4 | 08_oop → 09_error_handling |
Bank Account System, Quiz |
| Week | Folder | Practice Projects |
|---|---|---|
| 5 | 10_advanced |
Data Processor, Voice Assistant |
| 6 | 11_projects |
Rock-Paper-Scissors, High Score System |
| 7 | 12_web → fastapi/ |
Hello Web, Campaign API |
| 8 | rest_api/ |
Travel Destinations API |
| Week | Folder | Practice Projects |
|---|---|---|
| 9 | llm_fundamentals/architecture |
Transformer from Scratch |
| 10 | llm_fundamentals/pre_training |
Train Your Own Model |
| 11 | llm_fundamentals/weight_loading |
Load GPT-2 Weights |
| 12 | llm_fundamentals/fine_tuning |
Fine-tune for Custom Tasks |
Guess the Number Game:
cd basics/11_projects
python 01_guess_number.pyFastAPI Server:
cd fastapi
uvicorn main:app --reload
# Open: http://127.0.0.1:8000/docsFlask REST API:
cd rest_api
python main.py
# Open: http://127.0.0.1:5000/destinations- Start at
basics/01_introduction/ - Read the README in each folder
- Run the examples and modify them
- Move to the next folder when ready
- Jump to any topic you want to learn
- Study the examples
- Build the projects in
11_projects/ - Try the Web APIs
- Explore LLM architecture in
llm_fundamentals/ - Build transformer models from scratch
- Fine-tune models for your use cases
| Category | Tools |
|---|---|
| Core | Python 3.10+ |
| Web APIs | FastAPI, Flask, SQLAlchemy |
| Deep Learning | PyTorch, Transformers |
| LLM Tools | LangChain, LlamaIndex, LitGPT |
| Data | NumPy, Pandas, Matplotlib |
Q: I'm getting an error. What do I do?
A: Read the error message carefully - it usually tells you what's wrong.
Q: Do I need to install all dependencies?
A: For basics, no. For web APIs and LLMs, yes. Install as needed.
Q: Can I skip ahead?
A: Yes, but following the order works best.
Q: How long does this take?
A: 2-3 hours/week = 3 months. 10 hours/week = 1 month.
Found a bug or want to add an example?
- Fork the repository
- Create a branch:
git checkout -b feature/your-idea - Make your changes
- Push:
git push origin feature/your-idea - Open a Pull Request
MIT License