Saturday, February 9, 2019

Python Operators

Following are some Operators in Python. Details of each kind of operators are provided in the link below each section.

Arithmetic Operators:

+----------+----------------------+
|    +     |    Addition          |
|    -     |    Subtraction       |
|    *     |    Multiplication    |
|    /     |    Division          |
|    **    |    Exponentiation    |
|    //    |    Floor Division    |
|    %     |    Remainder         |

+----------+----------------------+

Know more about Arithmetic Operators here.

Conditional Operators (Relational Operators):

+---------+-----------------------+
|    <    | Less than             |
|    >    | Greater than          |
|    <=   | Less than or equal    |
|    >=   | Greater then or equal |
|    ==   | Equal                 |
|    !=   | Not equal             |
+---------+-----------------------+

Know more about Relational Operators here.

Logical Operators:

+------------+-----------------+
|     or     |   Logical OR    |
|     and    |   Logical AND   |
|     not    |   Logical NOT   |
+------------+-----------------+

Know more about Logical Operators here.

Identity Operators:

+-----------+--------------------------------+
|   is      |  is having the same id()?      |
|   is not  |  is not having the same id()?  |
+-----------+--------------------------------+

Know more about Identity Operators here.

Membership Operators:

+----------+--------------------------------+
|  in      |  if present in a sequence      |
|  not in  |  if not present in a sequence  |
+----------+--------------------------------+

Know more about Membership Operators here.

Bitwise Operators:

+-------+------------------+
|   &   |   Bitwise and    |
|   |   |   Bitwise  or    |
|   ^   |   Bitwise  xor   |
|   ~   |   Bitwise not    |
+-------+------------------+

Know more about Bitwise Operator here.

Shift Operators:

+--------+-----------------+
|   <<   |   Left Shift    |
|   >>   |   Right Shift   |
+--------+-----------------+

Know more about Shift Operators here.

Assignment Operators:

+-------+--------------------------------+
|  =    |  Assignment                    |
|  +=   |  Increment by a value          |
|  -=   |  Decrement by a value          |
|  *=   |  Increment by a multiple       |
|  /=   |  Decrement by a quotient       |
|  %=   |  Decrement by remainder        |
|  **=  |  Increment by exponent         |
|  //=  |  Decrement by floor division   |
+-------+--------------------------------+

Know more about Assignment Operators here.

No comments: