Operators in Paython
Advertisements
Operators in Python
Operators are the special symbol which is used with operands and generate output.
Operators | Description |
---|---|
// | Perform Floor division(gives integer value after division) |
+ | Used for addition |
- | Used for subtraction |
* | Used for Multiplication |
/ | Used for Dividion |
% | To return remainder |
** | Perform exponent(raise to power) |
< | Less than |
> | Greater than |
<= | Less than or equal to |
> | Greater than or equal to |
== | Equal to |
!= | not equal to |
<> | Not equal to(same like !=) |
= | Assignment |
/= | Divide and Assign |
+= | Add and assign |
-= | Subtract and Assign |
*= | Multiply and assign |
%= | Modulus and assign |
**= | Exponent and assign |
//= | Floor division and assign |
and | Logical AND(When both conditions are true output will be true) |
or | Logical OR (If any one condition is true output will be true) |
not | Logical NOT(Compliment the condition i.e., reverse) |
in | Returns true if a variable is in sequence of another variable, else false. |
not in | Returns true if a variable is not in sequence of another variable, else false. |
is | Returns true if identity of two operands are same, else false |
is not | Returns true if identity of two operands are not same, else false. |
Google Advertisment