Assignment and other operators

M3-R5.1 · Chapter 4: Operators, Expressions and Python Statements · 1 min read

4. Assignment Operators

These are used to assign values to variables. They can also combine assignment with other operations like addition or multiplication.

5. Identity Operators

These compare the memory locations of two objects to check whether they are the same object or not.

Note – For integers python store the value upto 256 on the same location bt for larger value it store it on different location that we can check by id() function.

Example –

6. Membership Operators

These check whether a value exists within a sequence such as a list, string, or tuple.

7. Bitwise Operators

These perform operations at the binary (bit) level. They are mainly used in low-level programming or performance- sensitive code.