Skip to content
Python by Example

Python 3.10+11 sections35 lessons4 projects

Learn Python by reading code you can actually run.

A structured path from print statements to APIs, tests, and CLI apps. Each lesson is a single file with comments, then a project that puts the idea to work.

01_basics/01_print.pyOpen lesson →
print("Hello, World!")
print("Welcome to Python!")
print("Name:", "Baraa", "| Age:", 25)
print("2025", "01", "15", sep="-")

Output

Hello, World!
Welcome to Python!
Name: Baraa | Age: 25
2025-01-15

Curriculum

Work in order, or jump to a topic. Every lesson is one file you can run.

Foundation

01–04

Syntax, control flow, and the data you print.

Core

05–08

Functions, modules, errors, and objects.

Practice

09–11

Write it clearly, then prove it with tests.

Projects

Four builds, in order. Try each one yourself, then open the solution.

P1

First projectBeginner

Number Guessing Game

Guess a number from 1 to 100. The game tells you higher or lower until you land it.

while loopsif / elsetry / except

P2

Intermediate

Expense Tracker

Record expenses, filter them by category, and keep the totals in a JSON file.

ListsDictionariesArguments

35 lessons. Begin at print().

Start with print()