Python: complete course
Learn Python from syntax through data structures, files, modules, OOP, testing, typing, APIs and practical automation/backend foundations. Every chapter ends with practical projects so you build while you learn.
1Python foundations and execution~10 min
What you are learning
1 Python foundations and execution ~10 min is a core part of PYTHON. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
print("Orbit Code")
name = "Alex"
print(name)Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused PYTHON mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
2Numbers, strings and expressions~12 min
What you are learning
2 Numbers, strings and expressions ~12 min is a core part of PYTHON. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
name = "Alex"
score = 82
print(name, score, type(score).__name__)Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused PYTHON mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
3Conditions and loops~14 min
What you are learning
3 Conditions and loops ~14 min is a core part of PYTHON. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
score = 82
if score >= 80:
print("Great")
for i in range(1, 4):
print(i)Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused PYTHON mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
4Functions and scope~16 min
What you are learning
4 Functions and scope ~16 min is a core part of PYTHON. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
def add(a, b):
return a + b
print(add(4, 6))Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused PYTHON mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
5Lists and sequences~18 min
What you are learning
5 Lists and sequences ~18 min is a core part of PYTHON. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
courses = ["HTML", "CSS", "Python"]
print([len(c) for c in courses])Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused PYTHON mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
6Tuples, sets and dictionaries~20 min
What you are learning
6 Tuples, sets and dictionaries ~20 min is a core part of PYTHON. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
course = {"title": "HTML", "chapters": 17}
course["done"] = True
print(course)Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused PYTHON mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
7Modules, packages and environments~22 min
What you are learning
7 Modules, packages and environments ~22 min is a core part of PYTHON. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
# project layout
# package/
# __init__.py
# lessons.py
# Use a virtual environment before installing packages.Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused PYTHON mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
8Errors and defensive programming~24 min
What you are learning
8 Errors and defensive programming ~24 min is a core part of PYTHON. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
try:
value = int("abc")
except ValueError as error:
print("Invalid number:", error)Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused PYTHON mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
9Files, paths and serialization~26 min
What you are learning
9 Files, paths and serialization ~26 min is a core part of PYTHON. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
from pathlib import Path
path = Path("notes.txt")
path.write_text("Orbit Code", encoding="utf-8")
print(path.read_text(encoding="utf-8"))Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused PYTHON mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
10Object-oriented Python~28 min
What you are learning
10 Object-oriented Python ~28 min is a core part of PYTHON. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
class Course:
def __init__(self, title):
self.title = title
c = Course("HTML")
print(c.title)Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused PYTHON mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
11Iterators, generators and decorators~30 min
What you are learning
11 Iterators, generators and decorators ~30 min is a core part of PYTHON. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
def count_up(n):
for i in range(n):
yield i
print(list(count_up(3)))Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused PYTHON mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
12Type hints and modern Python~32 min
What you are learning
12 Type hints and modern Python ~32 min is a core part of PYTHON. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
def greet(name: str) -> str:
return f"Hello {name}"
print(greet("Sam"))Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused PYTHON mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
13Testing and project quality~34 min
What you are learning
13 Testing and project quality ~34 min is a core part of PYTHON. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
def add(a, b):
assert a + b == b + a
add(2, 3)Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused PYTHON mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
14HTTP, APIs and automation~36 min
What you are learning
14 HTTP, APIs and automation ~36 min is a core part of PYTHON. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
from urllib.request import urlopen
import json
# Use a trusted API in a real project.
# response = json.load(urlopen("https://example.com/data.json"))Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused PYTHON mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
15Databases with Python~38 min
What you are learning
15 Databases with Python ~38 min is a core part of PYTHON. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
import sqlite3
con = sqlite3.connect("courses.db")
con.execute("create table if not exists course (id integer, title text)")
con.commit()
con.close()Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused PYTHON mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
16Backend foundations with Python~40 min
What you are learning
16 Backend foundations with Python ~40 min is a core part of PYTHON. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
def health():
return {"status": "ok"}
print(health())Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused PYTHON mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example
17Capstone: practical Python application~42 min
What you are learning
17 Capstone: practical Python application ~42 min is a core part of PYTHON. Learn the vocabulary, syntax, execution or data model, why the feature exists, how it interacts with earlier concepts, and the mistakes that cause real programs to fail.
How it works
Practice the smallest useful version first, then change inputs, combine it with earlier concepts, and inspect what happens when assumptions are wrong. Production code favors clear, testable solutions over clever tricks.
Practical example
courses = [{"title": "HTML", "done": False}]
completed = [c for c in courses if c["done"]]
print(completed)Practice: Change one part of the example, predict the result, run it when supported, then deliberately make one small mistake and fix it.
Projects
Do these after the explanation. Do not copy the example unchanged; build the projects from memory and use the reference only when stuck.
- Build a focused PYTHON mini-project
- Build a second project combining this chapter with earlier concepts
- Rebuild the project without copying the example