A Wandering Mind · Computer Science
PYTHON GUIDE

Learn · Run · Break · Fix

A learning series from A Wandering Mind

Eighteen interlinked lessons on strings, lists, files, exceptions, and dictionaries—with original explanations, runnable examples, real output, and supporting CPSC 1301K lectures.

course.py
>>> guide = {
...   "lessons": 18,
...   "modules": 5,
...   "python": "3.10+"
... }
>>> guide["goal"] = "understand it"
Course overview 18 lessons 5 modules Python 3.10+ Start Lesson 1 →

Computer Science · Python 3.10+

Learn Python through small ideas that build on each other.

This beginner-to-intermediate guide teaches strings, lists, file input and output, exception handling, and dictionaries through original explanations, runnable code, real output, common mistakes, and short practice exercises. Selected CPSC 1301K lectures by Hyrum Carroll are included as supporting classroom references—not as a substitute for the written lessons.

18 interlinked lessons
5 focused modules
3+ runnable examples per lesson
Python 3 examples verified on modern Python

Start here

The first lesson makes output easier to read.

Python becomes much more useful once programs can turn values into readable text. The opening lesson starts with formatted strings and f-strings, then the course moves into splitting, joining, and eventually data structures that can hold much more information.

Module 1 · Strings

Formatting Strings and f-strings

Learn how to place variables and expressions directly inside strings, control how values are displayed, and avoid the quoting and conversion mistakes that often trip up newer Python programmers.

Begin with formatted strings →
language = "Python"
lessons = 18

print(f"{language}: {lessons} lessons")

# Output:
# Python: 18 lessons

A tiny preview. Each lesson explains the idea before asking you to use it.

Course map

Five modules, one continuous learning path.

The sequence is designed so later lessons reuse ideas introduced earlier. You can jump around when you already know the prerequisites, but first-time learners will get the most from following the modules in order.

01

Strings

Format text, split it into pieces, and join pieces back together.

2 lessons · Beginner
02

Lists

Create, inspect, change, slice, copy, combine, loop through, and nest ordered collections.

8 lessons · Beginner → Intermediate
03

Files

Open, read, write, and safely close files using modern context-manager patterns.

4 lessons · Intermediate
04

Errors

Use defensive checks and exception handling without hiding real programming mistakes.

1 lesson · Intermediate
05

Dictionaries

Store values by key, copy mappings safely, and choose between lists and dictionaries.

3 lessons · Intermediate

Complete outline

All 18 Python lessons.

Every lesson includes original written instruction, at least three runnable examples with real output, a Common mistakes section using authentic Python errors, practice exercises, and one or two supporting videos from the CPSC 1301K lecture series.

Module 1 · Strings Build readable output, then learn how strings can be divided and recombined.
  1. 01Formatting Strings and f-strings
  2. 02Splitting and Joining Strings
Module 2 · Lists Move from individual values to ordered collections, references, methods, loops, and nested data.
  1. 03Creating Lists and Empty Lists
  2. 04Indexing Lists and Measuring Length
  3. 05Changing and Removing List Items
  4. 06Combining and Repeating Lists
  5. 07Slicing Lists and Testing Membership
  6. 08References, Aliasing, and Copying Lists
  7. 09List Methods and Built-in Functions
  8. 10Looping Over Lists and Nested Lists
Module 3 · Files Take data beyond a single program run by learning safe file-reading and file-writing patterns.
  1. 11How File I/O Works, and Opening a File
  2. 12Verifying a File Opened, and Closing It Properly
  3. 13Reading a File, Line by Line
  4. 14Writing to a File
Module 4 · Errors Learn when to check before acting and when to let Python raise an exception you can handle.
  1. 15Exception Handling vs. Defensive Checks
Module 5 · Dictionaries Store data by meaningful keys and finish by choosing the right structure for a problem.
  1. 16Dictionaries: Keys, Values, and Methods
  2. 17Checking Keys and Copying Dictionaries
  3. 18List or Dictionary? Choosing the Right Structure

How this guide works

Read it, run it, break it, fix it.

Programming sticks when you can predict what code will do, see what actually happens, and understand the difference. Each page is designed around that loop rather than around passive watching.

Original written lessons

The explanations and examples in this guide are written independently by A Wandering Mind. The pages are intended to remain useful even if every embedded video disappears.

Code with real output

Examples are written for Python 3.10+ and executed before publication. When a lesson demonstrates a mistake, the traceback shown is generated by an actual failing example.

Practice without spoilers

Each lesson ends with short exercises. Solutions stay collapsed until you choose to open them, so you can attempt the problem before comparing your approach.

Videos as supporting references

Selected lectures from Hyrum Carroll's CPSC 1301K series are embedded with YouTube's privacy-enhanced player. They provide a second classroom explanation after the written material.

About the lecture sequence: The source playlist's native ordering runs roughly backward compared with this guide's learning path. We reorganized the topics into a sequence that starts with strings, builds through lists and files, then finishes with exceptions and dictionaries. You can also open the original CPSC 1301K playlist on YouTube ↗.

Keep learning

Python here. Practice tools across the Kestrel network.

A Wandering Mind is building this course as a readable programming guide. Kestrel Exams focuses on practice and study tools, so the two projects can support different parts of the same learning process.

Available now

Working on Java too?

Kestrel Exams already has Java-focused study resources. They are separate from this Python course, but useful if your computer-science classes move between both languages.

In development

More Python practice

A dedicated Kestrel Exams Python study guide is being developed separately from these lessons. The link is intentionally low-key while that project takes shape.

Future Kestrel Python guide ↗