Beginner to Advanced ⏱ 18 Hours 📚 5 Lessons & Labs ⭐ Comprehensive Curriculum

🐍 Python Complete Programming Language Guide

Complete Python language mastery: data structures, list comprehensions, object-oriented programming (OOP), context managers, decorators, and automation scripting.

Beginner • Chapter 1: Python Fundamentals & Data Structures
⏱ 10 min 📈 Beginner

Language Syntax, Typing & Built-in Structures

Learn Python core syntax, clean indentation conventions (PEP 8), dynamic typing, and collections (lists, tuples, dicts, sets).

The Zen of Python

Python emphasizes readability, simplicity, and rapid development. It powers everything from backend web development (Django, FastAPI) to data science, artificial intelligence, and operating system automation.

Core Data Structures

  • Lists: Ordered, mutable sequences: [1, 2, 3].
  • Tuples: Ordered, immutable sequences: (10, 20).
  • Dictionaries: Key-value hash maps: {"name": "Alice", "role": "Dev"}.
  • Sets: Unordered collections of unique elements: {1, 2, 3}.
Python
# Comprehensive Python Fundamentals Demonstration
def process_user_metrics(users: list[dict]) -> dict:
    total_users = len(users)
    active_users = [u for u in users if u.get("is_active", False)]
    
    return {
        "total_registered": total_users,
        "active_count": len(active_users),
        "activity_rate": f"{(len(active_users) / total_users) * 100:.1f}%"
    }

sample_data = [
    {"username": "hk1_student", "is_active": True},
    {"username": "guest_reader", "is_active": False},
    {"username": "lead_engineer", "is_active": True}
]

metrics = process_user_metrics(sample_data)
print("Computed System Metrics:", metrics)
💻 Interactive Sandbox Playground (Python)
Editor Input
Console Output
Press "Run Code" to execute in virtual runtime.
Next: Classes, Dunder Methods & Inheritance →
Intermediate • Chapter 2: Object-Oriented Programming (OOP) in Python
⏱ 13 min 📈 Intermediate

Classes, Dunder Methods & Inheritance

Master object-oriented design in Python using constructors (__init__), string representations (__repr__), encapsulation, and polymorphism.

Object-Oriented Design in Python

In Python, everything is an object. Creating custom classes allows developers to bundle state and behavior into clean, reusable abstractions.

Python
class BookCourse:
    def __init__(self, course_id: str, title: str, duration_hours: int):
        self.course_id = course_id
        self.title = title
        self.duration_hours = duration_hours
        self._enrolled_students = []

    def enroll(self, student_name: str) -> None:
        self._enrolled_students.append(student_name)
        print(f"Enrolled {student_name} into {self.title}")

    def __repr__(self) -> str:
        return f"<BookCourse id='{self.course_id}' title='{self.title}'>"

course = BookCourse("PY-101", "Python Mastery", 18)
course.enroll("Alex")
print(course)
💻 Interactive Sandbox Playground (Python)
Editor Input
Console Output
Press "Run Code" to execute in virtual runtime.
Advanced • Chapter 3: File I/O, Context Managers & Automation
⏱ 11 min 📈 Advanced

Context Managers & Automated File Processing

Learn safe resource handling using the with statement, JSON manipulation, and automating administrative workflows.

Resource Safety with Context Managers

Opening files or network sockets without proper cleanup risks resource leaks. The Python with statement guarantees that resources are closed automatically, even if unhandled exceptions occur during execution.

Python
import json
from pathlib import Path

def write_and_read_config():
    config = {
        "platform": "HK1Books IT Learning",
        "version": "2.0",
        "courses_enabled": 12
    }
    
    # Serializing JSON securely
    serialized = json.dumps(config, indent=4)
    print("Serialized Configuration:")
    print(serialized)

write_and_read_config()
💻 Interactive Sandbox Playground (Python)
Editor Input
Console Output
Press "Run Code" to execute in virtual runtime.
Quiz • Chapter 4: Knowledge Assessment Quiz
⏱ 6 min 📈 All Levels

Python Core Knowledge Quiz

Test your understanding of Python list comprehensions, mutability, and dictionary methods.

📝 Python Core Knowledge Quiz
Score: 0 / 2
Question 1: What is the primary difference between a Python List and a Python Tuple?
Question 2: Which keyword guarantees that a file or network stream will be safely closed?
Projects • Chapter 5: Real-World Capstone Projects
⏱ 15 min 📈 Advanced

Python Automation Capstone Projects

Develop an automated directory organizer and a command-line expense tracker.

Project 1: Automated File System Organizer

Intermediate

Write a Python utility that scans a target folder and categorizes files into subdirectories (Images, Documents, Code, Archives) based on extensions.

Production Blueprint
import os
import shutil
from pathlib import Path

EXTENSIONS = {
    'Images': ['.png', '.jpg', '.jpeg', '.svg'],
    'Documents': ['.pdf', '.docx', '.txt'],
    'Code': ['.html', '.css', '.js', '.py']
}

def organize_directory(target_path):
    # Categorizes incoming files into clean subdirectories
    pass

Project 2: CLI Expense Manager & Reporting Engine

Advanced

Build an interactive command-line expense manager supporting categorization, CSV persistence, and terminal summary visualizations.

Production Blueprint
class ExpenseManager:
    def __init__(self, filename="expenses.csv"):
        self.filename = filename
    def add_expense(self, category, amount, description):
        # Writes record to CSV file
        pass
← Previous: Python Core Knowledge Quiz