What are operators?
Operators are symbols that perform operations on values. Think of them as the “verbs” of programming - they make things happen! You already know most operators from math class:- Calculate:
+,-,*,/ - Compare:
>,<,== - Combine:
and,or,not
Arithmetic operators
These work just like your calculator:Order of operations
Python follows math rules (PEMDAS):Comparison operators
These compare values and return True or False:Don’t confuse
= (assignment) with == (comparison)!age = 18stores 18 in ageage == 18checks if age equals 18
Logical operators
These combine boolean values and conditions:Truth tables
Understanding howand, or, and not work:
Assignment shortcuts
These shortcuts update variables in place:Common mistakes
Division always returns float
Division always returns float
Order of operations
Order of operations
Confusing = and ==
Confusing = and ==
What’s next?
You know operators! Let’s dive deeper into working with text strings.String manipulation
Advanced text operations