# Operators in Python

\operators are used to perform various operators in every programming language.

operator is a symbol to perform task,operands are values

- Arithmetic Operators
- Comparison Operators
- Assignment Operators
- Logical Operators
- Bitwise Operators

## Arithmetic Operators

arithmetic operations are performed using arithmetic operators, arithmetic operations like addition, subtraction and division are performed

Operator | Description | example |
---|---|---|

+ | Addition operator | 22+22=44 |

- | Subtraction operator | 10-6=4 |

* | Multiplication operator | 10*2=20 |

/ | Float Division Operator | 10/2=2.0 |

// | Integer Division Operator | 10//2=2 |

% | Remainder Operator | 10/2=5 |

** | Exponentiation Operator | 2**3=8 |

**float division** operator( / ):this operator returns remainder of two operands in float format (decimals), example is given below

**Integer Division Operator (//)**: this operator returns remainder of two operands in integer format, an example is given below

**Comparison Operators**

comparison operators are also know as Relational operators,these will retrun in output in the Boolean value like True or False

Operator | Description | Example | Return Value |
---|---|---|---|

Smaller than | 4 | True | |

> | Greater than | 2>7 | False |

Smaller than or equal to | 4 | True | |

>= | Greater than or equal to | 10>=2 | True |

!= | Not equal to | 5!=5 | False |

!ERROR! unexpected operator '=' | equal to | 6==6 | True |

## Assignment Operators

Operator | Example | Equivalent Statement |
---|---|---|

+= | x += 10 | x = x + 10 |

-= | x -=10 | x = x - 10 |

*= | x *= 10 | x = x * 10 |

/= | x /= 10 | x = x / 10 |

//= | x //= 10 | x = x // 10 |

%= | x %= 10 | x = x % 10 |

**= | x **= 10 | x = x ** 10 |

any operator preceding assignment operator are modified ,and performed a specific operation

## Logical Operators

logical operators are used compare two Boolean values , Expressions containing logical operators are known as Logical expressions

Operator | Usage | Description |
---|---|---|

and | x and y | True if both sides of the operator is True |

or | x or y | True if either of the operand is True |

not | not x | Complements the operand |