Fundamentals
Core syntax and structural constructs of the language. Learn how Python binds names to objects, evaluates expressions, and handles fundamental collections with zero external dependencies.
Chapter Lessons
Variable
Variables in Python are names bound to objects, rather than statically typed memory boxes.
Expression
Expressions evaluate to a value, in contrast to statements which perform an action.
String
Strings (`str`) are immutable sequences of Unicode code points.
List
Lists (`list`) are mutable, ordered sequences of elements.
Tuple
Tuples (`tuple`) are immutable, ordered sequences of elements.
Set
Sets (`set`) are mutable, unordered collections of unique, hashable elements.
Dict
Dictionaries (`dict`) are associative containers that map keys to values.
Conditional
Conditional statements control the flow of execution based on boolean evaluations.
Loop
Loops are to expressions as multiplication is to addition. They help us run the same code many times until a certain condition is not met. This module shows how to use the for-loop and while-loop, and also shows how `continue` and `break` give us precise control over a loop's lifecycle.
Function
Functions are reusable blocks of code that perform a specific task.
Comprehension
Comprehensions provide a concise, declarative syntax for constructing collection types (lists, sets, dicts) and generator expressions from existing iterables.