Free Handbook · Runs in your browser

Python Handbook

Learn Python by running it. Sixteen modules from your first print() to a job: every example is editable and runs right here, loops and function calls are traced line by line, and the real errors you will hit are explained with the fix. Problem-solving patterns, Python with real tools, interview questions, a certification exam, and a resume check at the end.

0 / 94 lessons🔥 0 day streak
ShareXLinkedIn

How this handbook works

Every lesson has code you can edit and run right here — the interpreter runs in your browser, nothing to install, a trace of what the interpreter did line by line where that matters, and the real error you will hit next, with why the interpreter said it and the fix. Lessons tick themselves as you go. Finish the handbook, sit the exam, get the certificate, then take your resume through the ATS checker and on to jobs.

16modules
94lessons
74runnable examples
27real errors explained

Module 00 · what you'll be able to do

  • Run Python right here in the browser and on your own computer
  • Write, read and trace your first program: add two numbers
  • Use comments and understand what the interpreter ignores
  • Know how the handbook ticks lessons and how to use AI while learning without cheating yourself
01

Why Python

Python is the language most people learn first, and the language most working engineers still reach for daily. It reads like English, it runs almost everywhere, and it is the default in the fields that are hiring: data engineering, machine learning, automation, backend APIs, and scripting inside every cloud. That combination — easy to start, hard to outgrow — is why it is the first handbook here.

You want to…Python gets you there with
Automate something boringThe standard library — files, dates, CSV, JSON, HTTP — with no installs
Work with datapandas, Spark (PySpark), SQL drivers, Airflow — the whole data stack speaks Python
Build an API or a web appFastAPI, Django, Flask
Do machine learning or AIPyTorch, scikit-learn, every LLM SDK
Pass a coding interviewShort, readable solutions — most interviewers accept Python
What Python is not
It is not the fastest language (C, C++, Rust and Go are), and it does not run in the browser natively (JavaScript does). When speed matters, Python usually calls a library written in C — which is why pandas and NumPy are fast even though Python is not.
02

Running Python — in this page and on your machine

Every example in this handbook is an editor with a Run button. Press it: the first time, your browser downloads a full Python interpreter (about 12 MB, once), then every run after that is instant and entirely local — nothing you type leaves your computer. Try it now. Change the text, run it again.

pythonEdit it. ⌘/Ctrl + Enter runs.
You should see
Hello, world!
Python is running in your browser.
Your turn
Change the second line to print your own name, then press Run (or ⌘/Ctrl + Enter).

On your own computer

For real projects you want Python installed locally. It takes five minutes:

  1. 1
    Install it

    Go to python.org/downloads and install the latest 3.x. On Windows tick "Add python.exe to PATH". On macOS and most Linux distributions it is already there — check with the next step.

  2. 2
    Check it works

    Open a terminal (Terminal on macOS, PowerShell on Windows) and type python3 --version (or python --version on Windows). You should see something like Python 3.13.2.

  3. 3
    Run a file

    Save the code above as hello.py, then run python3 hello.py. That is the whole workflow: write a file, run it.

  4. 4
    Get an editor

    VS Code with the Python extension is what most people use. It underlines mistakes before you run.

shell
$ python3 --version
Python 3.13.2
$ python3 hello.py
Hello, world!
Python is running in your browser.

The terminal session you should see. $ is the prompt — you do not type it.

The REPL
Type just python3 and you get a prompt (>>>) where each line runs as you press Enter. It is the fastest way to try one thing. exit() leaves it.
03

Your first program: add two numbers

Here is the program every Python tutorial starts with, and for good reason — it uses a variable, an operator, a function call and a formatted string, which is most of what a program is. Run it, then read the trace below to see what the interpreter actually did with each line.

pythonEdit it. ⌘/Ctrl + Enter runs.
You should see
5 + 7 = 12
Your turn
Change a and b to decimals like 2.5 and run again. Then try a = "5" (with quotes) — read the error, and we will explain it in Module 01.
VisualizeWhat the interpreter does with those four linesStep 1 / 4
a = 5
b = 7
total = a + b
print(f"{a} + {b} = {total}")
Line 1

Create the integer 5 and bind the name a to it. A variable is a name pointing at a value — nothing is "stored in" a.

Variables now
a5
All 4 steps as a table
StepLineWhat happenedVariables now
11Create the integer 5 and bind the name a to it. A variable is a name pointing at a value — nothing is "stored in" a.a = 5
22Same again: the name b now points at 7.b = 7
33Evaluate the right-hand side first: look up a (5), look up b (7), add them to get a new integer 12. Then bind total to it.total = 12
44Build the f-string by replacing each {…} with the value of the expression inside it, giving "5 + 7 = 12", then pass that string to print, which writes it followed by a newline.
Variable
A name bound to a value. a = 5 reads "let a refer to 5". Python has no declarations — the first assignment creates the name.
Expression
Anything that produces a value: 5, a + b, len("hi"). Statements (like assignment or print(...)) do something with them.
f-string
A string starting with f in which {expression} is replaced by the expression's value. The modern way to build text from values.
Quick check

After total = a + b, what happens to total if you later change a?

04

Comments

Anything after # on a line is a comment: the interpreter skips it entirely. Comments are for the next human — often you, next month. Write why, not what; the code already says what.

pythonEdit it. ⌘/Ctrl + Enter runs.
You should see
$59.97
Your turn
Put a # in front of the last line and run — nothing prints. That is the quickest way to switch a line off while debugging.

Comments that waste space

  • x = x + 1 # add one to x
  • # loop over the list above a loop over the list
  • A block of commented-out code left for months

Comments that earn their place

  • # retry once: the API drops ~1% of first calls
  • # cents, not dollars — see invoice rounding bug #412
  • A one-line note on a non-obvious decision
Multi-line "comments"
Python has no block comment syntax. A string on its own line ("""like this""") is legal and ignored at runtime, which is why people use it — but the proper use of triple-quoted strings is docstrings, the first line of a function or module, which tools actually read. You meet those in Module 04.
05

How this handbook works

Sixteen modules, each its own page, each a set of lessons like this one. The rail on the left lists them; the bar at the top of the page and the pill at the bottom-left track how far you are. A lesson ticks itself when you reach its end or run its code, and the tick survives closing the tab — no account needed.

  • Run blocks are the point. Every one is meant to be edited. Break it, fix it, guess the output before you press Run.
  • Trace blocks (the purple ones) step through code the way the interpreter does. Use them whenever a loop or a function call feels like magic.
  • Error cards (red) show one real error each — the code that causes it, the traceback, why, and the fix. Module 11 collects all of them into one index.
  • Quick checks are one question each. Get one wrong and the explanation tells you which idea to re-read.
  • The learning board (bottom-left pill) has the roadmap, this module's lessons and errors, and a tutor that can see the code you last edited.
  • The handbook ends with a certification exam (Module 15 → exam), then the ATS resume checker and the job board. That is the whole point: from print() to a job.
A pace that works
One module a day, every day, beats a weekend binge. Each module is 60–90 minutes if you run everything. The streak counter in the hero exists for exactly this reason.
06

Using AI to learn (without cheating yourself)

You have an AI assistant that can write any of this code for you. Used well, it makes you learn faster than any previous generation could. Used badly, it produces people who can prompt for a program and cannot read one — and interviews find that out in ten minutes. The rule is simple: the AI explains, you type.

Learning nothing

  • "Write a function that counts words in a file" → paste → move on
  • Pasting an error and pasting the fix back without reading either
  • Asking for the answer to an exercise

Learning fast

  • "I wrote this — why does it print None?" (paste your own code)
  • "Explain this traceback line by line" — then fix it yourself
  • "Give me three exercises on dictionaries, no solutions"
  • "Is there a more Pythonic way to write this?" after it already works

The tutor in the learning board is built this way on purpose: it can see the code you edited and explain it, but it gives short examples, not finished programs. Every run block here is also a place to test what an AI told you — models are confidently wrong about Python more often than you would think, and running the code is the only referee.

pythonEdit it. ⌘/Ctrl + Enter runs.
You should see
None
[1, 2, 3, 4]
Your turn
Before you run it: what do you think prints? append changes the list in place and returns None — one of the most common surprises in Python, and the reason to always run the code.

Every lesson in the handbook

16 modules · 94 lessons · each one ticks itself when you reach the end or run its code.

00Getting Started0 / 6
01Fundamentals0 / 6
02Flow Control0 / 5
03Data Types0 / 7
04Functions0 / 6
05Modules & Packages0 / 5
06Files & Data0 / 5
07Exceptions0 / 5
08Objects & Classes0 / 7
09Advanced Python0 / 6
10Regex, Date & Time0 / 5
11Errors & Debugging0 / 6
12Problem Solving0 / 7
13Python + Tools0 / 9
14Interview Questions0 / 5
15Job Ready0 / 4

Frequently asked questions

Is this Python handbook free?
Yes — every module, every runnable example and the certification exam are free, with no signup and no paywall. The exam asks you to sign in with Google so the certificate can carry your name.
Do I need to install Python?
No. Every example runs inside your browser: press Run and a full CPython interpreter (Pyodide) is downloaded once, then everything executes locally. Nothing you type is sent to a server. Module 00 also shows you how to install Python on your own machine for when you want to build real projects.
How long does it take?
Reading and running the sixteen modules takes roughly 20 to 25 hours. Most people do a module a day. The lessons tick themselves as you go, so you can stop and resume where you left off.
What is different from Programiz or W3Schools?
They teach syntax; this handbook also teaches the fifteen errors every beginner hits and why the interpreter says them, a line-by-line trace of what actually happened, eight problem-solving patterns, Python with SQL, pandas, FastAPI, Docker and AWS, sixty interview questions by level, and a job-ready module that ends at the ATS resume checker and the job board.
Which Python version?
Python 3.13 runs in your browser here, and everything taught is valid on any Python 3.10 or newer, including match statements and modern type hints.
Is there a certificate?
Yes. Pass the 25-question exam with 70% or more and generate a SolutionGigs Python certificate with your name, score, date and a certificate ID — download it, print it or add it to LinkedIn.

Finish the Python handbook, then get hired

Sit the exam for your certificate, run your resume through the ATS checker, and see the jobs that ask for exactly this.

Check my resume
Found this course useful? Share it.
ShareXLinkedIn

Comments

0

Join the conversation. Sign in to leave a comment — we'd love to hear your thoughts.