0% found this document useful (0 votes)
6 views7 pages

Python Operators Overview and Types

The document provides an overview of various operators in Python, including arithmetic, comparison, assignment, logical, bitwise, membership, and identity operators. Each type of operator is briefly defined with examples of their functionality. This information is essential for understanding how to perform operations and comparisons in Python programming.

Uploaded by

ronak agrawal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views7 pages

Python Operators Overview and Types

The document provides an overview of various operators in Python, including arithmetic, comparison, assignment, logical, bitwise, membership, and identity operators. Each type of operator is briefly defined with examples of their functionality. This information is essential for understanding how to perform operations and comparisons in Python programming.

Uploaded by

ronak agrawal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Python

Operators
Python offers a rich set of operators for various
operations. These operators enable powerful and flexible
code.
by ronak agrawal
Arithmetic Operators
1 Addition (+) 2 Subtraction (-)
Adds two operands. Subtracts the second operand from the first.

3 Multiplication (*) 4 Division (/)


Multiplies two operands. Divides the first operand by the second.
Comparison Operators
Operator Meaning

== Equal to

!= Not equal to

> Greater than

< Less than

>= Greater than or equal to

<= Less than or equal to


Assignment Operators
Basic Assignment (=)
Assigns a value to a variable.

Addition Assignment (+=)


Adds and assigns.

Subtraction Assignment (-=)


Subtracts and assigns.

Multiplication Assignment (*=)


Multiplies and assigns.
Logical Operators
and or not

True if both operands are true. True if at least one operand Inverts the truth value of
is true. its operand.
Bitwise Operators
& (AND) | (OR)
Bitwise AND operation. Bitwise OR operation.

^ (XOR) ~ (NOT)
Bitwise XOR operation. Bitwise NOT operation.
Membership and Identity
Operators
1 in
Checks if a value is present in a sequence.

2 not in
Checks if a value is not present.

3 is
Checks if two variables refer to the same object.

4 is not
Checks if two variables do not refer to the same object.

You might also like