A comprehensive, hands-on curriculum built to take you from Python basics to software engineering and core mathematics for AI.
This repository is a self-contained, practical learning suite designed for developers, data scientists, and aspiring AI engineers. Every module emphasizes practical execution: learn, see, practice, and build.
🚧 Project Status: In Progress (Modules
00through15currently implemented)
Build things. Break things. Fix things. Ship things.
Every module in this repository follows a consistent, production-oriented structure:
- Learn concepts with detailed explanations (
theory.md) - See clean, runnable code demonstrations (
examples.py) - Practice hands-on problems with solution validation (
exercises.py) - Build functional mini-projects (
project.py) - Explore interactively with data/math plots (
notebook.ipynb| Data & Math modules)
module_folder/
├── README.md # Module context, prerequisites, estimated time, and objectives
├── requirements.txt # Python dependencies required for the module
└── topic_subfolder/
├── theory.md # Theoretical foundations & best practices
├── examples.py # Runnable code demonstrations
├── exercises.py # Guided practice problems & answers
├── project.py # Real-world mini-project implementation
└── notebook.ipynb # (Data & Math modules) Interactive visual Jupyter notebooks
Master fundamental syntax, memory model, data structures, and program flow.
| Module | Subtopics Included | Primary Mini-Projects |
|---|---|---|
🔹 00_foundations |
Variables, primitive types, arithmetic/logical operators, I/O, PEP8 style | Interactive CLI Calculator |
🔹 01_control_flow |
if/else, match/case, for & while loops, break/continue/pass |
Number Guessing Game |
🔹 02_data_structures |
Lists, tuples, sets, dictionaries, list/dict comprehensions | Contact Management System |
🔹 03_functions |
Functions, positional/keyword arguments, *args/**kwargs, lambdas, recursion |
Math Utility Library |
🔹 04_modules_packages |
Module importing, custom packages, __init__.py, virtual environments |
Custom Python Package |
🔹 05_error_handling |
try/except, finally/else, exception hierarchy, custom exceptions |
Robust File Processor |
Work with file formats, object-oriented architecture, advanced language features, and Python's standard library.
| Module | Subtopics Included | Primary Mini-Projects |
|---|---|---|
🔹 06_file_handling |
Reading/writing text files, JSON serialization, CSV manipulation | Data Format Converter Tool |
🔹 07_object_oriented_programming |
Classes, objects, attributes, inheritance, polymorphism, encapsulation, magic methods | Bank Account Management System |
🔹 08_advanced_python |
Decorators, generators, iterators, closures, custom context managers | Reusable Context Manager |
🔹 09_standard_library |
os/sys, datetime, collections, itertools, argparse |
Automated CLI File Organizer |
Build maintainable, well-tested, high-performance, and network-connected applications.
| Module | Subtopics Included | Primary Mini-Projects |
|---|---|---|
🔹 10_testing_debugging |
unittest, pytest, interactive debugging with pdb, standard logging |
Automated Test Suite & Log Audit |
🔹 11_performance_optimization |
Time complexity (Big-O), code profiling, threading, multiprocessing, asyncio |
Concurrent Web Scraper |
🔹 12_databases |
SQLite basics, PostgreSQL connection, ORM with SQLAlchemy | Task Manager with DB Persistence |
🔹 13_networking_web_basics |
Sockets, HTTP requests, web scraping, REST APIs with Flask & FastAPI | Secure REST API & Web Scraper |
The mathematical and data engineering foundation powering modern Artificial Intelligence.
| Module | Subtopics Included | Primary Mini-Projects |
|---|---|---|
🔹 14_data_science_basics |
NumPy arrays, Pandas DataFrames/Series, data cleaning, Matplotlib & Seaborn visualization | Real-World Dataset EDA |
🔹 15_math_for_ai |
Vectors, matrices, dot products, norms, Cosine similarity, Bayes' Theorem, Gaussian stats, Z-scores, CLT, Markov chains | Movie Recommender, Neural Layer Pass, Spam Classifier & Anomaly Detector |
- Python 3.10 or higher.
- Git, VS Code, or any preferred IDE with Jupyter support.
# Clone the repository
git clone https://github.com/hamzalafsioui/python_4_all.git
cd python_4_all
# Create a virtual environment
python -m venv .venv
# Activate the virtual environment
# Windows (PowerShell):
.venv\Scripts\Activate.ps1
# Linux / macOS:
source .venv/bin/activateEach module specifies its requirements in its root directory. For example, to install dependencies for Module 15 (Math for AI):
pip install -r 15_math_for_ai/requirements.txtYou can run any .py file directly from the command line:
# Run code demonstrations
python 00_foundations/variables_and_types/examples.py
# Run practice exercises
python 00_foundations/variables_and_types/exercises.py
# Run mini-projects
python 15_math_for_ai/linear_algebra_basics/project.pyModules 14 and 15 feature interactive .ipynb notebooks for visual plots and mathematical exploration. Launch Jupyter Notebook or JupyterLab:
jupyter notebook 15_math_for_ai/linear_algebra_basics/notebook.ipynb-
00_foundations| Python Foundations -
01_control_flow| Decisions & Loops -
02_data_structures| Lists, Tuples, Sets, Dicts -
03_functions| Functions, Lambdas, Recursion -
04_modules_packages| Packages & Environments -
05_error_handling| Exceptions & Resilience -
06_file_handling| File I/O, JSON, CSV -
07_object_oriented_programming| OOP & Magic Methods -
08_advanced_python| Decorators, Generators & Context Managers -
09_standard_library| Standard Utilities & CLI -
10_testing_debugging| Unit Testing & Logging -
11_performance_optimization| Async, Multiprocessing & Profiling -
12_databases| SQL & SQLAlchemy ORM -
13_networking_web_basics| HTTP, FastAPI & Web Scraping -
14_data_science_basics| NumPy, Pandas & Data Visualization -
15_math_for_ai| Linear Algebra, Probability, Statistics & Matrix Computing
This repository is maintained as an open-source learning resource. Contributions, fixes, and improvements are welcome!