Feature Top (Full Width)

Showing posts with label How may type of operators in python programming. Show all posts
Showing posts with label How may type of operators in python programming. Show all posts

Python Programming operators

Wednesday, April 8, 2020


Python Programming Operators

  • Arithmetic Operators
  • Comparison Operators
  • Assignment Operators
  • Logical Operators
  • Membership Operators
  • Identity Operators
  • Bitwise Operators




Arithmetic Operators

+ Addition                                        
- Subtraction
* Multiplication
/ Division
% Modulus (Remainder)
** Exponent Power
// Floor division


Comparison Operators

== Equals
!= Not Equal
<> Not Equal
> Greater than
< Less than
>= Greater than equals
<= Less than equals

Assignment Operators

= Assign Values
+= Addition
-= Subtraction
*= Multiplication
/= Division
%= Modulus (Remainder)
**= Exponent Power
//= Floor division

Logical Operators

AND Returns true only if all conditions are true
OR Returns true only if any conditions are true
NOT Inverts the result

Membership Operators
 
IN True if Variable is a part of another variable
NOT IN True if Variable is NOT a part of another variable

Identity Operators
 
IS True if Variable is both variables are at same memory location
IS NOT True if Variable is both variables are NOT at same memory location

Bitwise Operators
 
& Binary AND
| Binary OR
^ Binary XOR
~ Binary Ones Complement
<< Binary Left Shift
>> Binary Right Shift