The Python Beginner Book
A free, read-in-order introduction to Python for complete beginners. Start at Chapter 1 and work straight through, or jump to a part you need. Each chapter explains one idea with plenty of examples, ends with a small exercise, and links to deeper reference pages when you want more detail.
No setup needed to read. When you’re ready to write code, Part 1 (Start here) shows you how to install Python and run your first program.
Part 1 Start here
What Python is, why it's worth learning, and getting your first program running.
Part 2 Foundations
The basic rules of how Python code is written and read.
Part 3 Variables and types
Storing data and the basic kinds of values Python works with.
- 11 Python Variables Explained for Beginners 7 min
- 12 Python Data Types Overview 7 min
- 13 Python Numbers Explained (int, float, complex) 6 min
- 14 Python Strings Explained (Basics and Examples) 7 min
- 15 Python Booleans Explained (True and False) 6 min
- 16 Type Conversion in Python (Casting Between Types) 7 min
Part 4 Collections
Grouping many values together with lists, tuples, sets, and dictionaries.
Part 5 Control flow
Making decisions and repeating work so programs can react and loop.
Part 6 Functions
Packaging code into reusable, named blocks that take input and return results.
Part 7 Errors and exceptions
Understanding error messages and handling them so programs don't just crash.
Part 8 Files, modules, and packages
Reading and writing files, and splitting code across modules you can import.
Part 9 Object-oriented programming
Modelling things as objects with their own data and behaviour.
Part 10 Going further
Powerful, slightly more advanced tools once the basics feel comfortable.