Learn Python
Learn Data Structure & Algorithm
Learn Numpy
Learn Pandas
Learn Matplotlib
Learn Seaborn
Learn Statistics
Learn Math
Learn MATLAB
Learn Machine learning
Learn Github
Learn OpenCV
Learn Deep Learning
MySQL Introduction
MySQL Setup
MySQL Operators
MySQL Basic Works
MySQL Create Table
MySQL insert and get values
MySQL Condition
MySQL GROUP BY
MySQL Case
MySQL sorting and calculate avg,sum,count
MySQL Update
MySQL Time
MySQL String
MySQL Rollback & Commit
MySQL Join and Concatenate
MySQL Index
MySQL Date
MySQL View
MYSQL With Python
Learn MongoDB
Learn Web scraping
Learn Excel
Learn Power BI
Learn Tableau
Learn Docker
Learn Hadoop
Operators are used to perform a lot of works. Like if you want to do sum of 2 and 2 then you need plus sign between these two numbers and this plus sign is an operator. There are too many operator available
1. Assignment operators
2. Arithmetic operators
3. Logical operators
4. Comparison operators
5. Bitwise operators
Assignment operators are used to assigning values to a variable.
Operator sign | Example | Short Form |
---|---|---|
= | x=5 | x=5 |
+= | x=x+3 | x+=3 |
-= | x=x-4 | x-=4 |
*= | x=x*5 | x*=5 |
/= | x=x/6 | x/=6 |
%= | x=x%4 | x%=4 |
//= | x=x//5 | x//=5 |
**= | x=x**6 | x**=6 |
&= | x=x&7 | x&=7 |
|= | x=x|4 | x|=4 |
^= | x=x^2 | x^=2 |
>>= | x=x>>1 | x>>=1 |
<<= | x=x<<3 | x>>=3 |
Arithmetic operators are used for doing mathematical operations.
Operator sign | Example |
---|---|
+ | 4+3 |
- | 4-4 |
* | 3*5 |
/ | 10/6 |
% | 5%4 |
// | 3//5 |
** | 8**6 |
Logical operators are used to combine conditional statement.
Operator sign | Example | Uses |
---|---|---|
and | x>5 and y<6 | It's return result if all conditions are true |
or | x>5 or y<6 | It's return result if single condition is true |
not | x>5 not y<6 | It's reverse the result |
Comparison operators are used to compare more than one value.
Operator sign | Example | Name |
---|---|---|
== | x==5 | Equal |
!= | x!=3 | Not equal |
> | x>4 | Greater than |
< | x<5 | Less than |
>= | x>=6 | Greater than equal |
<= | x<=4 | Less than equal |
Bitwise operators are used to compare binary number.
Operator sign | Example | Use |
---|---|---|
& | AND | Sets each bit to 1 if both bits are 1 |
| | OR | Sets each bit to 1 if one of two bits is 1 |
^ | XOR | Sets each bit to 1 if only one of two bits is 1 |
~ | NOT | Inverts all the bits |
>> | LEFT SHIFT | Shift left by pushing zeros in from the right and let the leftmost bits fall off |
<< | RIGHT SHIFT | Shift right by pushing copies of the leftmost bit in from the left, and let the rightmost bits fall off |