$ python -i course.py
Learn Python by writing it.
Learn Python by writing it, one small concept at a time.
Small, runnable concepts in five chapters. No jargon, no tool overload — just open a file and start typing.
Getting Started
Your first runs, a working setup, and the habit that keeps you going.
- 01Your First Python Program
Your first Python program is not about building something impressive.
- 02Why Python Is a Good First Language
Choosing a first programming language is less about finding the single best language in the world and more about finding one that lets you build momentum.
- 03Setting Up Python Simply
Setting up Python simply means getting a working Python environment on your computer with as few steps as possible.
- 16Reading Error Messages
Reading error messages is the skill of interpreting the feedback Python gives you when something goes wrong.
- 17Writing Your First Script
Writing your first script is about creating a small, complete program that does something useful or interesting.
- 18A Daily Practice Habit
A daily practice habit is not about becoming a different person overnight.
Core Python
Variables, text, collections, loops, and the decisions your code makes.
- 04Variables and Data Types
Variables and data types are the fundamental building blocks of any Python program.
- 05Strings and Text
At its heart, this concept is about how a programming language represents and manipulates text.
- 06Lists and Collections
Lists and collections are about grouping related pieces of data so your program can work with them as a unit.
- 19Loops That Do the Work
At its heart, a loop is a way to tell the computer to repeat a set of instructions without you having to write them over and over.
- 20Conditionals and Decisions
Conditionals are how your program makes choices.
- 21Dictionaries and Mappings
At its heart, a dictionary is a way to store and retrieve data by a name rather than by a position.
Functions & Logic
Reusable blocks, arguments, scope, and debugging your own thinking.
- 07Functions That Make Sense
At its heart, a function is a way to give a name to a small piece of work.
- 08Arguments and Returns
Arguments and returns are the two-way street of a function.
- 09Scope and Naming
Scope is the set of rules that determines where a name can be seen and used in your program.
- 22Debugging Your Logic
Debugging your logic is the disciplined process of finding and fixing mistakes in how your code thinks, not just how it looks.
- 23Writing Readable Code
Writing readable code is about making your functions easy for humans to understand.
- 24Common Python Mistakes
This concept is about recognizing the classic mistakes that beginners make when writing functions in Python.
Data & Files
Reading, writing, parsing, and the errors that show up around files.
- 10Reading and Writing Files
Reading and writing files is how your Python programs interact with data that lives outside the program itself.
- 11Working With Text Files
Working with text files in Python is about reading from and writing to files on your computer that contain plain text.
- 12Parsing Simple Data
Parsing simple data means taking text that already has some structure and turning it into values your program can work with directly.
- 25Handling Errors Gracefully
Handling errors gracefully is about writing code that anticipates problems and responds to them in a controlled way, rather than letting the program stop abruptly.
- 26Organizing a Small Project
Organizing a small project is about giving your code a clear structure so that you, and anyone else who reads it later, can understand what each part does and where…
- 27Using Libraries Wisely
Using libraries wisely means choosing the right tools for file handling tasks instead of writing everything from scratch.
Real Projects
Small tools, automation, tests, and sharing something that actually runs.
- 13Your First Small Project
Your first small project is not about building something impressive or solving a huge problem.
- 14Automating a Boring Task
Automating a boring task means teaching your computer to do something you currently do by hand, over and over, without needing you to sit there and click or type.
- 15A Command-line Tool
A command-line tool is a program you run from a terminal or command prompt.
- 28Reading and Improving Code
Reading and improving code is the practice of understanding existing Python programs and then making them clearer, more correct, or easier to change.
- 29Testing Your Code
Testing your code is the practice of writing small programs that check whether other parts of your program behave the way you expect.
- 30Sharing Your Project
Sharing your project means making your work visible to other people.