Operators are the verbs of Python — they add, compare and combine the values your program holds.
1 Arithmetic
+ - * / do the math you know; / always returns a float, even 10 / 2.
2 Comparisons
> < == != compare two values and answer with True or False.
3 Logic
and, or and not combine booleans into smarter questions.
4 Precedence
* binds tighter than +; parentheses ( ) let you decide the order yourself.
Doing things with values
Arithmetic1+ - * / do the math you know; / always returns a float, even 10 / 2. Comparisons2> < == != compare two values and answer with True or False.
Logic3and, or and not combine booleans into smarter questions. Precedence4* binds tighter than +; parentheses ( ) let you decide the order yourself. 4 building blocks make up Doing things with values
Press Run and follow 5 + 3 * 2 from raw tokens to a single value.
One program, every operator family — watch each print produce its answer.
Console
output appears as the program runs…
Parentheses change everything. Trace each line before you guess.
Your predicted output — one line per console line
Hint: Multiplication runs before addition. and needs both sides True; or is happy with one.
Click a symbol, then click what it really does.
5 conceptsTap a card to expand ?+drops into place
?*drops into place
?==drops into place
?anddrops into place
?notdrops into place
01/ always produces a float — even 10 / 2 prints 5.0.
02Comparisons and logic always answer with a bool: True or False.
03* runs before +; use parentheses to force your own order.
04and needs both sides True, or needs at least one, not flips the answer.
05Operators work on many types: + adds numbers but glues strings.