Operators and Type of Operators

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

Operators

An Operators are special symbols or keywords used to perform operations on variables and values

                                                                     OR

         An Operators are particular symbols which operate on some values and produce an output.

OPERAND: -  An operand is an entity on which the operator acts (Work)

OR

                     The values on which operator work are known as Operands.

Example:   a+b

Here the + is an operator which specifies the operation of addition on the two operands a and b

Example: 4+5 =9

Here 4 and 5 are Operands and (+), (=) signs are the operators. They produce the output 9

NOTE: A binary operator is an operator that takes two arguments and a unary operator operates on a single value

There are following type of Python operator’s:

  1. Arithmetic Operators.
  2. Relational Operators.
  3. Logical Operators.
  4. Assignment Operators
  5. Membership Operators.
  6. Identity Operators
  7. Bitwise Operators

1. Arithmetic Operators:

They are the most common. You have done this earlier. Python has seven arithmetic operators Used for mathematical operations .these are as follows

2. Comparison (Relational) Operators:

These compare two values and return a Boolean result (True or False) based on the relationship between them.

Python has 6 relational operators they include

3.Logical Operators

Logical operators are used on conditional statements (either True or False).They perform Logical AND, Logical OR and Logical NOT operations.