Lecture 3 b Handout Operators
Lecture 3 b Handout Operators
Operators in Python are symbols or keywords used to perform operations on variables and values.
They allow you to manipulate data and build expressions in a program. Python provides a variety of
operators categorized based on their functionality.
1. Arithmetic Operators
Used for basic mathematical operations:
2. Comparison Operators
Used to compare two values and return a Boolean result (True or False):
3. Logical Operators
Used to combine conditional statements:
1
4. Assignment Operators
Used to assign values to variables:
5. Bitwise Operators
Operate at the binary level on integers:
6. Membership Operators
Used to check for membership in sequences like lists, strings, or tuples:
7. Identity Operators
Used to compare memory locations of objects: