Beginner Foundations
Variables, types, conditionals, loops, lists and functions — paced over 48 one-hour lessons packed with text-based games (Mad Libs, Rock-Paper-Scissors, Magic 8-Ball, Hangman, Text Adventures, Number Guesser), bug-hunt challenges and mini-projects.
- 01
Welcome to Python: What Is Code?
Install Thonny / IDLE and run your very first program.
- 02
Talking to the Computer
print()and writing comments. - 03
Boxes for Data: Variables & Names
Naming rules and storing values.
- 04
Numbers, Math & Calculator Magic
Integers, floats,
%and**. - 05
Words & Letters: Strings 101
Quotes, joining and length.
- 06
Mad Libs: Build Your First Word Game
Use variables and strings to make a silly story generator.
- 07
Listening to the User:
input()Read text, convert to numbers.
- 08
Making Choices:
if/else/elifIndentation and branches.
- 09
True or False? Booleans & Comparisons
==,!=,<,>. - 10
Combining Choices
The logical operators
and,or,not. - 11
Mini-Game: Rock, Paper, Scissors
Combine
input,ifandrandomto beat the computer. - 12
Doing Things Again:
whileLoopsCounters and stop conditions.
- 13
Counting Loops:
for&range()Iteration and step values.
- 14
Loop Challenges: Patterns & Pictures
Draw triangles, squares and stars in ASCII art.
- 15
Treasure Chests: Lists Introduction
Indexing,
append,len. - 16
List Iteration:
for item in listWalk through every item without an index counter.
- 17
List Toolbox:
append,pop,remove,sortFive list methods you'll use every day.
- 18
List Slicing & Negative Indices
list[1:3],list[-1],list[:]— picking a range. - 19
Random Deep Dive:
choice&shufflePick one item or reshuffle a whole list with
random. - 20
Game: Magic 8-Ball
A random answer-picker built from a list and
random.choice(). - 21
Game: Lucky Draw Picker
Spin a hawker-stall menu and pick tonight's makan.
- 22
Challenge: List Lab
Find the max, total, count and duplicates in a list — without using
max()at first. - 23
Strings Toolbox:
upper,lower,replace,countFour string methods that unlock most word-game logic.
- 24
String Indexing & Slicing
Strings behave like lists of letters —
word[0],word[-1],word[::-1]. - 25
Game: Anagram Detective
Sort the letters of two words and check if they match.
- 26
Functions 101:
def& CallingWrap reusable steps in a named recipe.
- 27
Function Parameters: Passing Data In
Send values to a function so it can do its job.
- 28
Multiple Parameters & Default Values
Functions with two or more inputs, plus the
name="…"default trick. - 29
Function Returns: Sending Data Back
Use
returnto hand a value back to the caller. - 30
Functions Practice: Math Toolbox
Build
square,cube,averageandis_eventogether. - 31
Functions + Lists Together
Pass a list to a function and have it report back.
- 32
Game: Quiz Engine — Part 1
Build a function that asks a question and checks the answer.
- 33
Game: Quiz Engine — Part 2 (Score & Feedback)
Add a running score, encouragement messages and a final report.
- 34
Challenge: Functions Decathlon
Ten timed mini-functions to write from scratch in 60 minutes.
- 35
Game: Hangman Lite — Part 1 (Pick & Reveal)
Pick a secret word and show dashes for the unknown letters.
- 36
Game: Hangman Lite — Part 2 (Lives & Win)
Track remaining lives and decide who wins.
- 37
Game: Hangman Lite — Part 3 (ASCII Polish)
Draw the gallows step-by-step with multi-line strings.
- 38
Project: ASCII Banner Generator
User types a name and the program prints it as big block letters.
- 39
Game: Text Adventure — Part 1 (Map & Choices)
Branching scenes with nested
ifs — leave the village or stay? - 40
Game: Text Adventure — Part 2 (Inventory Lists)
Pick up items, drop them, check the bag — lists drive the inventory.
- 41
Game: Text Adventure — Part 3 (Boss Fight)
HP, attacks and a
whilebattle loop with random damage. - 42
Challenge: Code Wars — Bug Hunt
Five broken scripts. Find each bug and patch it.
- 43
Challenge: Code Wars — Predict the Output
Read tricky snippets and write down what they'll print before you run them.
- 44
Challenge: Code Wars — Speed Round
Ten micro-problems against the clock.
- 45
Game: Number Guesser — Part 1 (Core Loop)
Pick a secret 1–100, loop until the user guesses it.
- 46
Game: Number Guesser — Part 2 (Difficulty Levels)
Easy / Medium / Hard change the range and the number of tries.
- 47
Game: Number Guesser — Part 3 (Hi-Score Table)
Store the best three scores in a list and print the leaderboard.
- 48
Capstone: Number Guessing Game Deluxe + L1 Recap
Bring every Level-1 skill into one polished game and review the level's headline ideas.
Data, Files & Tooling
Collections, strings, files, errors and modules — then a practical software toolkit: regular expressions, JSON, and visual programming with Turtle. Forty-eight one-hour lessons that turn code into real programs which read, save and process data, with multi-part games (Wordle-Lite, Tic-Tac-Toe, Turtle Race) along the way.
- 01
Lists Deep Dive: Methods Recap
append,insert,remove,sort,reverse— the L1 list toolkit, used in anger. - 02
List Comprehensions Teaser
A 1-line preview of
[x*2 for x in nums]. Full deep-dive in L3. - 03
Locked Boxes: Tuples
Immutable ordered collections — and when to prefer them over lists.
- 04
Tuple Unpacking & Multiple Return Values
a, b = (1, 2)and functions that return more than one thing. - 05
Labelled Storage: Dictionaries
Keys, values, lookups by name instead of by index.
- 06
Dictionary Methods:
keys,values,itemsIterate a dict three different ways.
- 07
Game: Secret Code Translator
Encode and decode messages with a key-value cipher.
- 08
No Duplicates Allowed: Sets
Unique items, fast membership checks.
- 09
Set Operations: union, intersection, difference
The maths-class operators, in code.
- 10
Game: Word Bingo with Sets
Mark called words off a bingo card built from a set.
- 11
Nested Worlds: Lists of Dicts
The shape every real dataset takes — students, products, scores.
- 12
Nested Worlds: Dicts of Lists
Group items by category — drinks by stall, songs by genre.
- 13
Challenge: Inventory Inspector
Query a nested data structure five different ways.
- 14
String Superpowers
split,join,strip,find— the four most-used string methods. - 15
f-strings: Modern String Formatting
Embed values cleanly:
f"Hi {name}!". - 16
f-string Specifiers: Width, Decimals, Padding
{price:.2f},{name:>10}— receipts and tables. - 17
Game: Mad Libs 2.0 with f-strings
Rebuild the L1 Mad Libs game with cleaner formatting.
- 18
Random Module: Dice, Cards & Coins
randint,choice,shuffle,sample. - 19
Game: Higher-or-Lower (Cards)
Deal from a shuffled deck and guess.
- 20
Reading Files:
open()andwithRead text from a file the safe way.
- 21
Writing Files: Saving Text to Disk
Append vs overwrite —
"a"vs"w". - 22
Game: High-Score Keeper (File-Backed)
Scores survive between runs.
- 23
Game: Wordle-Lite — Part 1 (Load Word Bank)
Read 100 5-letter words from a file and pick a secret one.
- 24
Game: Wordle-Lite — Part 2 (Feedback Logic)
Right letter right place, right letter wrong place, missing.
- 25
Game: Wordle-Lite — Part 3 (Polish & Stats)
Six tries, ASCII colour codes, a final stats line.
- 26
Error Handling:
try/exceptCatch crashes before they end the program.
- 27
Specific Exceptions & Multiple
exceptBlocksCatch
ValueErrorseparately fromFileNotFoundError. - 28
finally&else: The Full Error FlowAlways-run cleanup and the happy-path block.
- 29
Challenge: Error-Proof Calculator
Build a calculator that survives every weird user input you can think of.
- 30
Importing from the Standard Library
import math,import statistics,from random import choice. - 31
Build Your Own Module
Save a function in one file, import it from another.
- 32
Datetime Basics: Dates, Times, Deltas
Today's date, time differences, formatting with
strftime. - 33
Turtle Graphics: Drawing with Code
Your first visual program — forward, right, left, penup.
- 34
Turtle: Loops & Patterns
Squares, stars, spirals — turtle + for loops.
- 35
Turtle: Colours & Pen Control
RGB,
fillcolor,begin_fill/end_fill. - 36
Game: Turtle Race
Four turtles, randomness and a finish line.
- 37
Game: Turtle Maze Walker
Arrow-key control to walk a turtle out of a maze.
- 38
Project: Turtle Mandala Generator
User picks a number and gets a one-of-a-kind geometric pattern.
- 39
Game: Tic-Tac-Toe — Part 1 (Board & Display)
A 3×3 nested-list board, printed cleanly each turn.
- 40
Game: Tic-Tac-Toe — Part 2 (Win Detection)
Check rows, columns and the two diagonals.
- 41
Game: Tic-Tac-Toe — Part 3 (Polish & Easy AI)
Random-move computer opponent and a play-again loop.
- 42
Regex 101:
re.findallandre.searchFind every phone number in a wall of text.
- 43
Regex Patterns: Character Classes & Quantifiers
\d,\w,+,*,?— the regex alphabet. - 44
Regex Project: Validators (email, IC, phone)
Build three validators that accept the real format and reject the fakes.
- 45
JSON Files:
dump&loadSave and reload nested Python data as text.
- 46
JSON Project: Quiz from a JSON File
Load questions from JSON, score answers, save high scores.
- 47
Challenge: Code Olympics — Mixed Skills
Eight timed problems mixing every Level-2 skill.
- 48
Capstone: Personal Notes & Tasks Manager
Build a CLI app that adds, lists, searches (regex) and saves (JSON) — your Level-2 toolkit, end-to-end.
OOP, Algorithms & Data Structures
Object-oriented design, generators, recursion, classic algorithms and your own data structures — taught through dungeon heroes, monster classes, fractal art, and a 48-lesson arc that ends with a Dungeon Quest capstone and the PCEP mock exam.
- 01
Classes 101: Blueprints for Objects
What a class is, what an instance is, and how they differ.
- 02
Attributes: Data Stored on an Object
Setting and reading instance attributes.
- 03
Methods: Functions Attached to a Class
Defining a method,
self, and calling it. - 04
The
__init__ConstructorBorn ready: initialise an object's data when it's created.
- 05
Many Objects from One Class
Build five heroes from one Hero class and store them in a list.
- 06
Game: Dungeon Hero Class
A Hero with HP, attack and inventory — the L3 mascot is born.
- 07
Inheritance: Child Classes
Reuse the parent class, extend the child.
- 08
Method Overriding &
super()Customise inherited behaviour while still calling the parent's version.
- 09
Game: Monster Family Tree
Goblin, Orc and Boss all inherit from Monster.
- 10
Encapsulation & Private-ish Attributes
The
_underscoreconvention and why "private" in Python is a polite request. - 11
Polymorphism Basics
Same method name on different classes — write code that doesn't care which.
- 12
Polymorphism Practice: A Shared Interface
Loop a list of mixed shapes and call .area() on each.
- 13
Game: Monsters with Different Attacks
Each monster overrides .attack() — polymorphism in action.
- 14
Dunder Methods Part 1:
__str__&__repr__Make
print(obj)show something useful. - 15
Dunder Methods Part 2:
__eq__&__lt__Compare and sort your own objects.
- 16
Dunder Methods Part 3:
__add__&__len__Make
a + bandlen(obj)work for your class. - 17
Project: Pet Shop Inventory
Class
Pet+ list of pets + price lookup + total stock value. - 18
@property: Computed AttributesLooks like an attribute, runs like a method — read-only derived values.
- 19
@staticmethod&@classmethodWhen the method doesn't need self — and when it needs the class itself.
- 20
Lambda Functions
Tiny anonymous helpers —
lambda x: x * 2. - 21
List Comprehensions
One-line lists — the most beloved Pythonic syntax.
- 22
Dict & Set Comprehensions
The same trick, applied to dicts and sets.
- 23
Filtering Inside a Comprehension
[x for x in nums if x > 0]— the if-clause. - 24
Challenge: Score Leaderboards
Comprehensions +
sorted+lambdato rank players. - 25
map()&filter()Built-insThe original functional tools — and why comprehensions usually win.
- 26
Iterators:
__iter__&__next__What a for-loop actually does behind the scenes.
- 27
Generators with
yieldFunctions that pause, return a value, and pick up where they left off.
- 28
Generators in Practice: Infinite Sequences
An infinite Fibonacci generator that doesn't blow up memory.
- 29
Game: Lazy Enemy Spawner
A generator drips enemies into a battle one at a time.
- 30
Challenge: Functional Olympics
Six problems solved with comprehensions, lambda and generators — no loops allowed.
- 31
Recursion 101: Base & Recursive Cases
Functions that call themselves — and how to stop them.
- 32
Recursion Practice: Factorial, Fibonacci, Powers
Three classic recursive functions, side by side with their iterative versions.
- 33
Game: Recursive Art — Trees with Turtle
A self-similar tree that branches forever.
- 34
Game: Recursive Art — Koch Snowflake
Add a bump to every line, repeat. A perfect snowflake emerges.
- 35
Game: Recursive Art — Sierpinski Triangle
A triangle of triangles of triangles.
- 36
Challenge: Recursion Lab
Five recursive problems — palindrome check, list flatten, directory walk and more.
- 37
Searching: Linear Search
The simplest search — walk the list until you find it.
- 38
Searching: Binary Search
Halve the list each guess — find an item in a million in twenty steps.
- 39
Sorting: Bubble Sort
Swap neighbours until the list is in order.
- 40
Sorting: Insertion Sort
Build the sorted list one card at a time, like a hand of cards.
- 41
Sorting: Python's
sorted()withkeyWhy you'll almost never write your own sort in real code.
- 42
Algorithm Complexity: Big-O Intuition
Why O(log n) beats O(n) beats O(n²), in human terms.
- 43
Data Structures: Stacks (LIFO)
Push, pop — undo buttons, browser history, function call stacks.
- 44
Data Structures: Queues (FIFO)
Enqueue, dequeue — print queues, task lists, breadth-first searches.
- 45
Linked Lists Part 1:
NodeClass & TraversalBuild your own list out of nodes — see what Python's list hides.
- 46
Linked Lists Part 2: Insert & Delete
Modify the chain without breaking it.
- 47
Capstone: Dungeon Quest — OOP RPG
Hero, monsters, inventory, battle loop and a recursive maze — every L3 idea in one game.
- 48
PCEP Exam Prep: Mock Exam & Review
Format walk-through, 10-question mock, weak-area review and a study plan.
Real-World Software & Databases
The level that opens job-shaped doors — JSON, CSV, REST APIs, web scraping, SQL & SQLite, pandas, matplotlib, Flask + auth. Forty-eight one-hour lessons, every project rooted in something a junior developer would actually be asked to build.
- 01
JSON Files: Read & Write
json.load,json.dumpand pretty-printing. - 02
JSON: Nested Data & Pretty Output
Indented JSON, traversing lists-of-dicts, the
indent=kwarg. - 03
CSV Files: The Spreadsheet of Code
Read every row, every column, with the csv module.
- 04
CSV Files: Writing & Updating Rows
Build a spreadsheet from Python data.
- 05
Project: CSV ↔ JSON Converter
Pick a direction, transform the file, prove the round-trip works.
- 06
Working with Dates & Times
datetime,strptime, deltas — real-world data is full of dates. - 07
Cleaning Messy Text Data
Strip whitespace, normalise case, handle missing fields.
- 08
Challenge: Data Janitor
Take a deliberately broken CSV and ship it clean.
- 09
APIs & the
requestsLibrarySend your first HTTP GET, read the JSON response.
- 10
REST APIs: GET Requests Deep Dive
Query parameters, status codes, response headers.
- 11
REST APIs: POST, Headers & Auth
Send data to a server; authenticate with an API key.
- 12
Project: Trivia Quiz from a Real API
Live questions from Open Trivia DB.
- 13
Project: Weather App for Malaysian Cities
Pull live forecasts and print a friendly summary.
- 14
Web Scraping: HTML Basics for Scrapers
Tags, attributes, the DOM tree — what BeautifulSoup walks.
- 15
BeautifulSoup: Selecting Elements
find,find_all, CSS selectors. - 16
Project: Shop Price Tracker
Scrape a price page daily, log changes to a CSV.
- 17
SQL Foundations:
SELECT,WHEREPick rows and columns from a sample DB.
- 18
SQL:
ORDER BY&LIMITSort the answers, take only the top few.
- 19
SQL:
GROUP BY& AggregatesCOUNT,SUM,AVG— summarise across rows. - 20
SQL:
INNER JOINCombine matched rows from two tables.
- 21
SQL:
LEFT JOINKeep everything on one side, even when the other has nothing.
- 22
SQLite with Python: the
sqlite3ModuleFrom the SQL shell into a Python script.
- 23
SQLite CRUD: Create, Read, Update, Delete
The four verbs of every database app.
- 24
Project: Library Management System
Books, members and loans across three tables.
- 25
Pandas: Loading & Exploring DataFrames
read_csv,head,describe,info. - 26
Pandas: Selecting Rows & Columns
df['col'],df.loc,df.iloc. - 27
Pandas: Filtering with Boolean Masks
df[df['price'] > 10]and chained conditions. - 28
Pandas: Grouping & Aggregating
groupby+agg— pivot tables, in code. - 29
Pandas: Cleaning (NaN, dtypes, duplicates)
Most data is dirty. Most data work is cleaning.
- 30
Pandas: Merging DataFrames
mergeon common keys — pandas's JOIN. - 31
Pandas: Sorting & Top-N Analysis
Who are the top 5? Which day was the worst?
- 32
Challenge: Investigate a Real Dataset
Five questions you must answer from a real Malaysian CSV.
- 33
Matplotlib: Bar Charts
The chart you'll draw most often.
- 34
Matplotlib: Line Charts & Time Series
Trends over weeks, months, years.
- 35
Matplotlib: Pie & Scatter
Showing proportions; spotting correlations.
- 36
Matplotlib: Subplots & Dashboards
Multiple charts in one figure — a one-page report.
- 37
Project: Data Story — A 3-Chart Report
Pick a dataset, ask a question, answer it with three charts.
- 38
Flask 101: Routes & Responses
Your first web app —
@app.route("/"). - 39
Flask: HTML Templates with Jinja
Pass data from Python into HTML.
- 40
Flask: Forms & POST Handling
Read what the user submitted.
- 41
Flask + SQLite: Database-Backed Blog
Posts saved to disk, listed on the home page.
- 42
Flask: User Sign-Up & Login
Password hashing with bcrypt, session cookies.
- 43
Flask: Sessions & Logout
Keep someone logged in across requests.
- 44
Flask: Deployment Walk-Through
Pick a host, push the code, get a public URL.
- 45
Data Ethics & Storytelling
Bias in data; honest charts; what NOT to show.
- 46
Statistics & Datetime Deep Dive (PCED-aligned)
mean,median,stdev, time-series — the maths PCED asks about. - 47
Capstone: Full-Stack Data Web App
Flask + SQLite + auth + a live dataset — your portfolio's first real project.
- 48
PCED Exam Prep: Mock Exam & Review
Data-analysis exam orientation, 10-question mock, study plan.
Python for AI & Modern Apps
Machine learning with scikit-learn, neural networks with Keras, computer vision with OpenCV, NLP, and real apps powered by LLM APIs (Claude and GPT). Forty-eight one-hour lessons, every concept introduced with a plain-English analogy before the library call.
- 01
Welcome to AI: What Can Computers Learn?
The big ideas behind machine learning, in plain English.
- 02
AI vs ML vs Deep Learning: A Plain-English Tour
How the buzzwords actually fit together.
- 03
The Data Mindset: Features & Labels
The two columns every ML problem starts with.
- 04
NumPy Basics: Arrays & Vectorisation
Why ML runs on arrays, not Python lists.
- 05
NumPy in Practice: An Image is an Array
Load a picture and treat its pixels as numbers.
- 06
Pandas for AI: Preparing Data
From raw CSV to a model-ready DataFrame.
- 07
Seaborn 101: Pretty Plots Fast
Spot patterns before you train.
- 08
Seaborn Deep Dive:
pairplot,heatmap, distributionsThe three plots you'll lean on for every dataset.
- 09
ML 101: Train, Test, Predict
The universal machine-learning recipe.
- 10
Train-Test Split & Cross-Validation
Why you never test on the data you trained on.
- 11
Accuracy, Precision, Recall
Reading a model's scorecard properly.
- 12
Your First Classifier: K-Nearest Neighbours
Ask your 5 closest friends what to choose.
- 13
Decision Trees: AI That Asks Questions
If-else, but learned from data.
- 14
Random Forests: Many Trees, One Vote
Bagging in one paragraph; sklearn in two lines.
- 15
Linear Regression: Predicting a Number
Fit a line, forecast a value.
- 16
Logistic Regression: Predicting Yes/No
Same shape, classification output.
- 17
Clustering: K-Means (Unsupervised)
Let the model find groups in your data.
- 18
Feature Engineering: Making Data Usable
Encoding, scaling, dropping — the boring part nobody can skip.
- 19
Project: Predict Titanic Survival
Your first complete ML pipeline.
- 20
Project: Malaysian Property Price Predictor
Real local data; fit, validate, present.
- 21
Neural Networks 101: Neurons & Layers
From one perceptron to a multi-layer net.
- 22
Activation Functions: ReLU, Sigmoid, Softmax
What makes a neural net actually learn.
- 23
Build a Tiny Neural Net with Keras
Three layers, one prediction.
- 24
Training a Neural Net: Loss & Optimisers
Gradient descent in pictures, not equations.
- 25
Overfitting: When AI Memorises
How to spot it and how to fix it.
- 26
Dropout & Regularisation
Two tricks that keep neural nets honest.
- 27
Project: Handwritten Digit Recogniser (MNIST)
The classic neural-net hello-world.
- 28
Project: Fashion Item Classifier
Train a model on 10 clothing categories.
- 29
Image Classification with Pre-Trained Models
Use ResNet / MobileNet without training from scratch.
- 30
OpenCV Basics: Load, Display, Resize, Filter
The four image operations you'll use most.
- 31
Face Detection with Haar Cascades
Find faces in a photo with one library call.
- 32
Webcam Streams with OpenCV
Read frames live and process them in a loop.
- 33
Project: Smile Detector App
Smile at the camera; the app responds.
- 34
NLP 101: Tokens, Stop-Words, Stemming
Teaching a computer what a 'word' is.
- 35
Bag-of-Words & TF-IDF
Turn text into numbers the model can read.
- 36
Sentiment Analysis
Is this review happy, sad or angry?
- 37
Pattern-Matching Chatbot (No API Needed)
Rules, keywords, scripted replies — the chatbot of the 90s, today.
- 38
Project: Cyberbullying Comment Filter
Train a classifier to flag harmful messages.
- 39
LLM APIs: First Call to Claude / GPT
Send a prompt, parse the streaming response.
- 40
Prompt Engineering: System vs User Prompts
Why the same question gives different answers.
- 41
Few-Shot Prompting: Teach by Example
Hand the model 3 examples; it generalises from there.
- 42
Tool Use: Letting the LLM Call a Function
The LLM picks the tool, your code runs it.
- 43
Streaming LLM Responses
Print tokens as they arrive — feels alive.
- 44
Project: Flask + LLM Chat App
Connect a real website to a real language model.
- 45
RAG Lite: Search Your Notes with an LLM
Embed your text, retrieve the right chunk, ground the answer.
- 46
AI Ethics: Bias, Fairness & Responsibility
The questions every AI builder must ask before shipping.
- 47
Capstone: Your AI-Powered Application
Pick a real problem you care about; build the model + the UI.
- 48
PCEI Exam Prep: Mock Exam & Review
AI-exam orientation, 10-question mock, study plan.
Testing & Quality
The level that turns coders into engineers — unittest, pytest, fixtures, mocking, coverage, TDD, integration testing, linting and type checking. Forty-eight one-hour lessons, building real test suites for the games and apps from earlier levels.
- 01
Why We Test: Real Bug Stories
From small typo to global outage — the cost of skipping tests.
- 02
Testing Vocabulary
Static vs dynamic, black-box vs white-box, smoke vs regression.
- 03
Testing Levels
Unit → integration → system → acceptance.
- 04
Manual Testing & Test Cases
Designing thoughtful test cases on paper, before any code.
- 05
Assertions in Python:
assertThe simplest test possible — a statement that must be true.
- 06
Writing Your First Test Without a Framework
Just a plain script that crashes on failure.
- 07
unittest: Python's Built-in FrameworkTestCase classes and your first green tick.
- 08
unittest:assertEqual,assertRaises& FriendsThe dozen assertions you'll actually use.
- 09
unittest:setUp&tearDownLifecycle hooks — set up once, run many.
- 10
unittest: Test Suites & DiscoveryRun all your tests with one command.
- 11
pytestIntro: Less BoilerplatePlain functions, plain asserts — why the industry loves it.
- 12
pytest: Naming Rules & Discoverytest_*.py,test_*functions — the conventions matter. - 13
pytest: Smart Assert IntrospectionWhen a plain assert fails, pytest tells you why.
- 14
pytestFixtures Part 1: Reuse Setup@pytest.fixture— your test data, ready to inject. - 15
pytestFixtures Part 2: Scope & Cleanupscope="module",yieldfor teardown. - 16
pytest: Parametrize One Test, Many Cases@pytest.mark.parametrize— table-driven testing. - 17
pytestMarkers:skip,xfail, customSkip slow tests; mark known failures; group tests by tag.
- 18
Project: Test the L2 Tic-Tac-Toe Engine
A full pytest suite for the game you wrote in Level 2.
- 19
Project: Test the L3 Dungeon Quest
Cover Hero, Monster, Battle and Inventory classes.
- 20
Challenge: Find the Hidden Bugs
Five working-but-subtly-broken functions; write tests that catch every bug.
- 21
Mocking 101: Why & When
Replace the slow / external bit with a stand-in.
- 22
unittest.mock.Mock&MagicMockObjects that record everything done to them.
- 23
Patching: the
@patchDecoratorSwap a real function for a fake one, for the test only.
- 24
Mocking a Database
Test your CRUD code without touching SQLite.
- 25
Mocking an HTTP API
Patch
requests.getso tests work offline. - 26
Challenge: Mock Olympics
Four tricky cases where mocks save the day.
- 27
Coverage 101: What Lines Got Hit?
Track which lines your tests executed.
- 28
pytest-cov: Measure & Visualise CoveragePer-file percentages and an HTML report you can browse.
- 29
Coverage Targets: How Much Is Enough?
Why 100% is a trap, and what to aim for instead.
- 30
TDD 101: Red → Green → Refactor
The three-step rhythm that changes how you write code.
- 31
TDD Walk-Through: Build a Calculator Test-First
Watch a real test-driven build, step by step.
- 32
TDD Project Part 1: Library Catalogue
Write the failing tests; make them pass.
- 33
TDD Project Part 2: Library Catalogue Polish
Refactor under green tests; add search, filter, sort.
- 34
Challenge: TDD a Mini-App
A 20-line spec; everyone TDDs it from scratch.
- 35
Integration Testing Concepts
When unit tests aren't enough — testing how the parts talk.
- 36
Testing a Flask App: The Test Client
Hit routes, assert on responses, no browser needed.
- 37
Testing Database Code: Real DB vs Mock
The eternal trade-off — speed vs realism.
- 38
Testing AI / ML Code
Determinism, seeds, what 'passing' even means for an ML model.
- 39
End-to-End Testing Intro
Drive the real browser, click the real buttons.
- 40
Project: E2E Test a Real Web App
playwright + pytest, the modern stack.
- 41
Static Analysis:
ruffThe fastest linter in the Python world — install, run, fix.
- 42
Static Analysis:
pylintDeeper, slower, opinionated — when you want the extra eyes.
- 43
Code Formatting:
black&isortStop arguing about spaces; let the tool decide.
- 44
Type Checking with
mypyCatch type bugs without running the code.
- 45
Pre-commit Hooks: Stop Bad Code Before Commit
Run ruff, mypy and your tests automatically on every git commit.
- 46
CI Basics: GitHub Actions for pytest
Push the branch; the cloud runs your tests; you get a tick or a cross.
- 47
Capstone: Bring a Real App to 90% Coverage
Take an existing repo (yours or a teammate's) and ship it with a real test suite.
- 48
PCET Exam Prep: Mock Exam & Review
Tester-exam orientation, 10-question mock, study plan.
Automation & DevOps
Save hours every week — file ops with pathlib, subprocess, scheduling, logging, web automation with Selenium / Playwright, email + Slack + Discord, scraping pipelines and SSH with paramiko. Forty-eight one-hour lessons, every project something a student could deploy to their own machine that night.
- 01
Why Automate? ROI & Boring Tasks
Spotting the tasks worth automating — and the ones that aren't.
- 02
Command-Line 101:
sys.argvThe simplest way to read arguments from the terminal.
- 03
argparsePart 1: Positional & Optional ArgsReal CLI tools with -h help text for free.
- 04
argparsePart 2: Subcommands & Defaultstool add,tool remove,tool list— git-style CLIs. - 05
pathlib: The Modern File-Path APIPathobjects beat string concatenation every time. - 06
pathlibin Practice: Find, Walk, GlobPath.rglob("*.csv")and friends. - 07
shutil: Copy, Move, Delete, ArchiveHigh-level file operations for whole folders.
- 08
osModule: Environment & Working Directoryos.environ,os.getcwdand friends. - 09
subprocessPart 1: Run a Commandsubprocess.run()— the safe modern way. - 10
subprocessPart 2: Capture Output & Pipe Inputcapture_output=Trueand stdin piping. - 11
Datetime Deep Dive: Parse, Format, Arithmetic
strptime,strftime,timedelta. - 12
Timezone-Aware Datetime:
zoneinfoWhy MYT/UTC matters when your bot runs at midnight.
- 13
Logging Part 1: Levels, Formatters, Handlers
Replace
printforever. - 14
Logging Part 2: File Logs & Rotation
Keep logs forever without filling the disk.
- 15
CSV Automation: Merge & De-Dupe
Combine five files; drop duplicates by key column.
- 16
Challenge: CSV Olympics
Six file-wrangling problems against the clock.
- 17
JSON Automation: Validate & Transform
Walk nested JSON; check schemas; rewrite shapes.
- 18
Excel Automation:
openpyxlReadOpen an .xlsx, read cells, traverse sheets.
- 19
Excel Automation:
openpyxlWrite & StyleGenerate styled reports with borders, colours and formulas.
- 20
PDF Automation:
pypdfRead & Extract TextPull text out of an invoice PDF.
- 21
PDF Automation: Merge, Split, Watermark
Cut a 200-page PDF into chapters; stamp a footer on every page.
- 22
Project: Multi-Format Report Generator
Take a CSV; output an Excel report, a PDF cover sheet and a JSON manifest.
- 23
Web Scraping for Automation: Robust Selectors
Selectors that survive minor HTML changes.
- 24
API Automation: Retries & Rate Limits
Back off and try again — the pipeline survives.
- 25
API Automation: OAuth & Tokens
Authenticate to real-world APIs without leaking keys.
- 26
Web Automation: Selenium Basics
Drive a real Chrome browser from Python.
- 27
Web Automation: Playwright (Modern Alternative)
Async, faster, batteries-included.
- 28
Project: Auto-Fill Form Bot
A bot that submits a daily form for you.
- 29
Email Automation:
smtplib& MIMESend programmatic emails — politely.
- 30
Email Automation: Attachments & HTML
PDF reports attached, styled message body.
- 31
Notifications: Slack Webhooks
Post a message to a channel in three lines.
- 32
Notifications: Discord Webhooks
Same idea, different platform — bridge them both.
- 33
SMS Notifications via API (Twilio teaser)
When email isn't urgent enough.
- 34
Project: Multi-Channel Alert System
Trigger → format → fan out to email + Slack + SMS.
- 35
Scheduling: the
scheduleLibraryPure-Python "every day at 8am" — no cron needed.
- 36
Scheduling: cron & Task Scheduler
Native OS schedulers — Linux/macOS cron and Windows Task Scheduler.
- 37
File Watching:
watchdogReact to a file appearing in a folder, instantly.
- 38
Backup & Sync Automation
Build your own mini Time Machine for one folder.
- 39
Database Backup Automation
Dump SQLite / Postgres on a schedule; rotate old dumps.
- 40
Project: Daily Report Bot
Scrape → transform → email at 8 a.m. every morning.
- 41
SSH with
paramikoPart 1: Connect & RunRun a command on a remote server from your laptop.
- 42
SSH with
paramikoPart 2: SFTP File TransferPush and pull files over SSH.
- 43
Server Health Checks
Ping, disk-usage, CPU, memory — automate the basics with
psutil. - 44
Project: Server Maintenance Toolkit
A CLI that backs up, restarts, and reports on a remote box.
- 45
Error Recovery in Long-Running Scripts
Retry, resume, skip — never crash a 4-hour pipeline an hour from done.
- 46
DevOps Mindset: Idempotence, Logging, Alerts
The three habits that separate scripts from systems.
- 47
Capstone: Workflow Orchestrator
A multi-step automation with logging, retries, reports and a Slack alert.
- 48
PCEA Exam Prep: Mock Exam & Review
Automation-exam orientation, 10-question mock, study plan.
Security & Cyber
Cybersecurity essentials — hashing & encryption, sockets & SSL, port scanning, system monitoring with psutil, the OWASP Top 10, secure coding, JWT/OAuth, secrets management and SSH with paramiko. Forty-eight one-hour lessons, every attack demoed in an isolated environment, every defence taught right after.
- 01
Welcome to Security: CIA Triad & Ethics
Confidentiality, Integrity, Availability — plus rules of engagement.
- 02
Threat Modelling: Think Like an Attacker
STRIDE in plain English; spot weak spots before they're exploited.
- 03
Network Basics: TCP/IP, Ports, Protocols
How a packet travels from your laptop to a server.
- 04
The OSI Model in One Hour
Seven layers, every one mapped to something a Python script touches.
- 05
DNS & How URLs Resolve
From `google.com` to an IP address, step by step.
- 06
Project: Passive Reconnaissance Toolkit
WHOIS, DNS lookups, public-record gathering — non-intrusive recon.
- 07
Sockets in Python: TCP Client
The
socketmodule — your own networking from scratch. - 08
Sockets in Python: TCP Server
Accept connections, echo back, handle multiple clients.
- 09
SSL/TLS: Secure Connections in Python
How HTTPS actually works under the hood.
- 10
Project: Encrypted Chat Server
Client + server + TLS — a 50-line private chat.
- 11
Hashing 101:
hashlibMD5, SHA-256 — one-way functions and why they matter.
- 12
Why Hashing Matters: Password Storage
Never store passwords in plain text. Ever.
- 13
Salting &
bcryptDeep DiveWhy "just hashing" isn't enough, and what
bcryptadds. - 14
Symmetric Encryption: Fernet
cryptography.fernet— one key encrypts and decrypts. - 15
Symmetric Encryption: AES Mode Comparison
ECB vs CBC vs GCM — why some modes are wrong.
- 16
Asymmetric Encryption: Public & Private Keys
The maths behind every HTTPS handshake.
- 17
Asymmetric in Practice: RSA Sign & Verify
Prove a message came from you without revealing the key.
- 18
Project: Encrypted Message Vault
Save secrets to disk; decrypt only with the right password.
- 19
Port Scanning: Concepts & Ethics
What scanning reveals and the laws around it.
- 20
Project: Build a Port Scanner
Scan a host on YOUR network, report open ports — ethically.
- 21
File Integrity Monitoring with Checksums
Detect when a file has been tampered with — even by one byte.
- 22
System Monitoring with
psutilWatch processes, memory and disks live.
- 23
Process Inspection & Anomaly Detection
Spot a process that shouldn't be there.
- 24
Network Sniffing Basics (scapy teaser)
What goes across a wire — and why HTTPS exists.
- 25
Log Analysis for Security
Find the needle (one suspicious login) in the haystack (10 000 lines).
- 26
Challenge: Intrusion Detective
Given three log files, identify the attack and the affected accounts.
- 27
OWASP Top 10 Tour
The classic web-app vulnerabilities — at a glance.
- 28
A01 — Broken Access Control
When the wrong user reaches the wrong endpoint.
- 29
A02 — Cryptographic Failures
Weak algorithms, default keys, leaked tokens.
- 30
A03 — SQL Injection: The Attack
Show the exploit on a deliberately broken demo app.
- 31
A03 — SQL Injection: The Defence
Parameterised queries — the only correct fix.
- 32
A07 — XSS: Cross-Site Scripting Attack
How a comment field can take over a page.
- 33
A07 — XSS: Defence (Sanitisation & CSP)
Output encoding and Content Security Policy.
- 34
A05 — Security Misconfiguration
Default credentials, exposed admin panels, debug pages in prod.
- 35
A08 — Software & Data Integrity Failures
Supply-chain attacks; what pinned dependencies actually buy you.
- 36
Challenge: OWASP Bug Hunt
A deliberately vulnerable Flask app — find and patch four bugs.
- 37
Authentication Basics: Sessions vs Tokens
How the web remembers who you are.
- 38
JWT: Structure, Signing, Validation
The three dots; why never trust a JWT you didn't validate.
- 39
OAuth 2.0: The Authorisation Code Flow
"Sign in with Google" demystified.
- 40
Access Control: RBAC Patterns
Roles, permissions, and how to wire them up in Flask.
- 41
Project: Add Auth + RBAC to a Flask App
Take the L4 blog and add admin / editor / reader roles.
- 42
Secure API Design Checklist
Ten things every public API must get right.
- 43
Subprocess Safely: Avoiding Command Injection
Why
shell=Trueis almost always wrong. - 44
Secrets Management: .env, Vaults, Key Rotation
Where keys go — and where they never should.
- 45
Logging & Audit Trails for Forensics
Logs that hold up in an investigation — and the ones that don't.
- 46
Security Reports: PDF, CSV, JSON Evidence
Generate handover documents your client can act on.
- 47
Capstone: Vulnerability Scanner
Combine scanning, hashing, reporting and ethics into a deliverable tool.
- 48
PCES Exam Prep: Mock Exam & Review
Security-exam orientation, 10-question mock, study plan.
Visual Game Builder
The friendliest entry into graphical games — sprites, sound, simple physics. Forty-eight one-hour lessons threaded with a dozen mini-games (Pong Lite, Brick Breaker, Asteroids, Endless Runner) leading to a two-part arcade-game capstone. Prerequisite: Level 2 (collections + files).
What you should already know
- From L1: variables & types,
if/elif/else,while/forloops, lists (index, append, slice), functions with parameters andreturn, therandommodule. - From L2: dictionaries, tuples, nested data, string methods & f-strings,
import, file I/O withwith, basictry/except. - Placement assessment available — 10–15 questions, ~30 minutes, 70% pass mark.
- 01
What Is Pygame Zero? Install & First Window
Install
pgzero, run an empty window, save the file. - 02
The Game Loop:
draw()&update()How a game ticks — 60 times per second.
- 03
Coordinates: Screen Origin & y-Axis
x, y and why y goes downwards in graphics.
- 04
Drawing Shapes: Rect, Circle, Line
Filled and outlined primitives.
- 05
Colours & Backgrounds
RGB tuples, named colours, gradient hacks.
- 06
Mini-Game: Doodle Pad
Draw with the mouse, clear with space.
- 07
Actors: Your First Sprite
Load an image, place it on the canvas.
- 08
Moving Actors:
actor.x += 1The simplest way to push a sprite around.
- 09
Velocity & Time-Based Movement
Why frame-rate-independent movement matters.
- 10
Multiple Actors: Lists of Sprites
Spawn many; update them all in a loop.
- 11
Mini-Game: Cat Parade
Ten cats walking in a line, each at its own speed.
- 12
Challenge: 100 Sprites at 60 FPS
Spawn 100 actors and keep the frame rate locked.
- 13
Keyboard Input: Arrow Keys
The
keyboardobject — held vs pressed. - 14
Keyboard Input: Multiple Keys at Once
Diagonal movement, run + jump combos.
- 15
Mouse Input: Click & Drag
on_mouse_down,on_mouse_move,on_mouse_up. - 16
Mini-Game: Sky Painter
Paint trails on the screen with the arrow keys.
- 17
Mini-Game: Bug Squasher
Click moving bugs before they escape.
- 18
Mini-Game: Cat & Mouse Chase
WASD to dodge, score for survival time.
- 19
Collision Detection:
colliderectHave two rectangles overlapped this frame?
- 20
Collision:
collidepoint(Mouse on Actor)Did the user click on the right sprite?
- 21
Collision Reactions: Bounce, Destroy, Score
What to do when things touch.
- 22
Mini-Game: Pong Lite
Two paddles, one ball, infinite rally.
- 23
Mini-Game: Brick Breaker
Smash a wall of bricks with a bouncing ball.
- 24
Sprite Animation: Cycle Frames
Swap costumes every few frames — a walking animation.
- 25
Sprite Animation: Direction-Based Frames
Face left, face right, face up — without flipping by hand.
- 26
Sound Effects:
sounds.boom.play()One-shot sounds that fire on event.
- 27
Background Music with
music.playLoop a track; fade in / fade out.
- 28
Mini-Game: Falling Stars with Sound
Catch the stars; chime on hit, thud on miss.
- 29
Mini-Game: Drum Machine
Click pads, schedule beats, play a loop.
- 30
Score, Lives & Health Bars
The numbers every arcade game shows.
- 31
Game States: Start → Play → Game Over
A single state variable, branching draw and update.
- 32
Saving High Scores to a File
Top 5 scores survive between sessions.
- 33
Mini-Game: Asteroids Lite — Part 1 (Movement)
Rotate, thrust, wrap around the screen.
- 34
Mini-Game: Asteroids Lite — Part 2 (Game States)
Start screen, play, game-over — and a hi-score table.
- 35
Simple Physics: Gravity & Jump
Constant downward acceleration; an impulse up.
- 36
Bouncing & Friction
Energy loss on each bounce; sliding to a stop.
- 37
Mini-Game: Gravity Catcher
Catch falling objects in a basket.
- 38
Mini-Game: Endless Runner — Part 1 (Movement)
Player runs; world scrolls; jump on spacebar.
- 39
Mini-Game: Endless Runner — Part 2 (Obstacles)
Procedurally spawn rocks and pits; score for distance.
- 40
Tile-Based Backgrounds
Build a level out of 16×16 tiles.
- 41
Scrolling Backgrounds
Parallax layers — clouds, hills, foreground.
- 42
Multiple Levels & Difficulty Curves
Progressive challenge — speed and spawn rates.
- 43
Particles: Explosions & Trails
Small sprites with short lives — fireworks made of code.
- 44
Screen Shake & Hit Flashes
The two tricks that make every hit feel solid.
- 45
Title, Pause & Game Over Screens
Three more states; clean transitions; clear instructions.
- 46
Challenge: Make Your Game Feel "Juicy"
Take a working game; add shake, particles, sound polish.
- 47
Capstone Part 1: Plan & Build Your Arcade Game
Choose a genre, sketch the design, build the prototype.
- 48
Capstone Part 2: Polish & Share
Add sound, score, juicy polish, and show it to your class.
Game Engineering
The full power of Pygame — sprite classes, scenes, particle systems, tile maps, 2D physics, dirty-rect optimisation. Forty-eight one-hour lessons, building toward a polished side-scroller capstone with parallax, particles, music and save slots. Prerequisite: Level 3 (OOP). Optional Pygame Zero recommended first.
What you should already know
- From L1–L2: everything required for Optional Pygame Zero (above).
- From L3 — OOP: classes,
__init__, methods, inheritance,super(), encapsulation, polymorphism, dunder methods (__str__,__eq__,__add__). - From L3 — Functional: lambdas, comprehensions, generators (
yield), iterators,map/filter. - From L3 — Algorithms & DS: recursion, linear & binary search, basic sorting, big-O intuition, stacks & queues, linked-list mental model.
- Recommended: Optional Pygame Zero — gives you the game-loop and sprite mental model before facing Pygame's boilerplate.
- Placement assessment available — 15–20 questions, ~45 minutes, 70% pass mark.
- 01
Pygame vs Pygame Zero
Why go deeper, and what Pygame Zero hid from you.
- 02
Setting Up:
pygame.init()& the Main LoopThe classic
while running:pattern. - 03
The Event System: Queue & Polling
Keyboard, mouse, quit — all through one queue.
- 04
Display Surface & Drawing Primitives
Surfaces, blits, and what actually gets drawn.
- 05
Coordinates & the
RectObjectThe Swiss-army knife of Pygame geometry.
- 06
Loading & Drawing Images
convert_alpha,blitand image performance. - 07
Sprites as Classes: Your First Player
OOP applied — every entity is a class.
- 08
Sprite Class: Image, Rect &
update()The three things every sprite must have.
- 09
Movement & Velocity Vectors
Smooth movement using x/y velocity components.
- 10
Diagonal Speed Normalisation
Why diagonal moves shouldn't feel faster.
- 11
Sprite Groups: Many Objects, One Update
Group.update()andGroup.draw(). - 12
Sprite Group Performance: Why Groups Matter
Spawn 1,000 sprites; keep 60 FPS.
- 13
Collision:
colliderectRectangle-vs-rectangle, the fast default.
- 14
Collision:
spritecollide&groupcollideOne sprite vs a group; group vs group.
- 15
Collision: Pixel-Perfect Masks
When rectangles aren't accurate enough.
- 16
Mini-Game: Top-Down Shooter — Part 1 (Player)
Player class, movement, shooting bullets.
- 17
Mini-Game: Top-Down Shooter — Part 2 (Enemies & Bullets)
Enemy spawner, sprite groups, collision resolution.
- 18
Mini-Game: Top-Down Shooter — Part 3 (Score & Game Over)
HUD, hi-score table, restart loop.
- 19
Sprite Sheets: Slicing Frames
One PNG, many frames — load once, blit cheap.
- 20
Animation: Frame Timing with Delta-Time
Animations that run at the same speed on every machine.
- 21
Animation: State Machine (Idle, Run, Attack)
Pick the right animation for the current action.
- 22
Mini-Game: Animated Boss Fight
Multi-phase boss with sprite-sheet animations.
- 23
Tile Maps: Loading Levels from CSV
A 2D grid of numbers → a 2D world of tiles.
- 24
Tile Maps: Loading from Tiled .tmx
Use the Tiled editor; load the file in Python.
- 25
Camera & Scrolling: Follow the Player
When the world is bigger than the window.
- 26
Camera: Smooth Lerp & Dead Zones
Cameras that don't snap or jitter.
- 27
Parallax Backgrounds
Layers that scroll at different speeds — instant depth.
- 28
Mini-Game: Side-Scroller — Part 1 (Movement & Camera)
Player + tile map + smooth-follow camera.
- 29
2D Physics: Gravity, Walking, Jumping
Velocity, gravity, ground detection.
- 30
2D Physics: Platform Collision Resolution
How to stop the player from falling through floors.
- 31
2D Physics: Wall Slides & Coyote Jump
Two tricks that make platformers feel right.
- 32
Mini-Game: Side-Scroller — Part 2 (Physics & Polish)
Add gravity, jumps, collectibles and a goal.
- 33
Particle Systems: Basic Particle Class
A short-lived sprite with velocity and a fade-out.
- 34
Particle Systems: Emitters & Object Pools
Spawn thousands without allocating thousands.
- 35
Mini-Game: Particle Showcase (Fireworks)
Click to launch; explode in colour.
- 36
Scene Management: Stack-Based State Machine
Push a pause scene; pop it back to the game.
- 37
HUD: Score, Health, Mini-Map
Drawing on top of the world.
- 38
UI: Buttons & Menus from Scratch
Click areas, hover states, keyboard navigation.
- 39
Title → Game → Pause → Game Over Flow
Four scenes, clean transitions, no leaks.
- 40
Settings Screen: Volume & Controls
Keybinds the player can change at runtime.
- 41
Sound Mixer: Music + SFX Channels
Background music, layered effects, master volume.
- 42
Sound Mixer: Channel Management
Reserve channels so important sounds aren't cut off.
- 43
Saving Progress: JSON + Pygame
High scores, settings, and a continue button.
- 44
Save Slots: Multiple Save Files
Three saves; load, overwrite, delete.
- 45
Performance: FPS Counter & Profiling
Measure before you optimise; show FPS in the HUD.
- 46
Performance: Dirty-Rect Drawing & Surface Re-Use
Two tricks that double the frame rate on slow machines.
- 47
Capstone Part 1: Design & Build
Choose a genre, plan the game, ship a playable prototype.
- 48
Capstone Part 2: Polish, Test & Ship
Particles, sound, save system, and a public release.