Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Types of operators in python

 Operators: 

  • Operators are nothing but the special symbols used in between the operands.
  • In python, we use the operators to perform some arithmetic, logic, and some more operations.
  • These operations are performed on the variables, values, arguments nothing but the operands.
  • We can perform operations on one or more operands.
  • In python, we have six operators.
  • Arithmetic( to add),comparison(to compare), logical( perform logical operations), bitwise(cal bitwise operations), assignment(assign values), special(check address and content ).

1.Arithmetic operator:

  • It is also called a math operator and it applicable for all int and float types values.
write a Python program using the math operators/arithmetic Operators.


  • The following link will show a detailed explanation of arithmetic operators.
  •  Click this link for more information about arithmetic operators

2. comparison operator:

  • It compares and shows the relation of variables.
write a python code using comparison operators.


  • The following link will give a detailed explanation of the comparison operators.
  •  Click the link for more information about the comparison operator


3. Logical operator: 

  •  This operator performs the logical operations on variables.
  • There are 3 logical operators.
write a Python Program using logical operators.


  • The following link shows more content about logical operators.
  •   Click the link for more information about logical operators.

4. Bitwise operator:

  • It is used to perform bit-wise calculations.
  • We have 6 operators and applied to int and bool.
write a python code using bitwise operators.


  • The Following shows detailed information.
  • Click the link for more information about bitwise operators.

5. Assignment operator:

  • It assigns the values to variables.
  • we have 12 operators in it.
write a python program using the assignment operators.


  • The following link shows a detailed explanation of the assignment operator.
  • Click the link for more information about assignment operators.

6.Special operator:

  • In, not in and is, is not are special operators.
  • Membership operators and identity operators are 2 types in it.
  • Membership operator is used to giving member is present in the list or not.
  • eg: list=[1,2,3]
  • pint(1 is a list )
  • output: true.
write a python program using the special operator.


  • The following link gives more information about the special operators.  
  • Click the link for more information about special operators.



This post first appeared on Java Tutorial - InstanceOfJava, please read the originial post: here

Share the post

Types of operators in python

×

Subscribe to Java Tutorial - Instanceofjava

Get updates delivered right to your inbox!

Thank you for your subscription

×