Operators Overview
Operators are little action signs.
They tell Python what to do with values.
Plus adds. Equals compares. And joins yes/no checks.
This lesson maps the main families. Later lessons zoom in.
Arithmetic operators
These do math.
+ - * / for basic math
// for whole-number divide
% for leftover
** for powers
Comparison operators
These ask questions and answer True or False.
Like asking, is this tower taller than that one?
Logical operators
These combine yes/no answers.
and, or, and not are the main ones.
Assignment operators
These put values into variables.
= is the main one.
Shortcuts like += mean, take the old value, change it, put it back.
Membership and identity
in asks if something is inside a collection.
is asks if two names point to the same object.
For most beginners, use == to compare values.
Order of work
Python does some operators before others.
Parentheses go first. Then powers. Then multiply and divide. Then add and subtract.
When unsure, use parentheses to make the order clear.
Tip: Learn the family first. Then practice each group in the next lessons.
Test yourself
Three quick questions made just for this lesson. Earn 10 XP per correct answer.