Operators in Python

 OPERATORS

An operator in a programming language is a symbol that tells the compiler or interpreter to perform specific mathematical, relational or logical operation and produce final result.

Types of Operators :

1) Arithmetic Operators :

  • Addition Operator : ' + '
  • Subtraction Operator : ' -
  • Division Operator : ' / '
  • Multiplication Operator : ' * '  
   Following are examples of Arithmetic Operators


2) Relational Operators :

  • Greater than : ' > '
  • Less than : ' < '
  • Equals : ' == '
  • Greater than Equal to : ' >= '
  • Less than Equal to : ' <= '
  • Not Equal to : ' != '  
     Following is the example of Relational Operators :


3) Logical Operators :

  • And Operator : ' &It returns TRUE if both the operands are True )
  • Or Operator : ' | '   ( It returns TRUE if either of the operand is True )
Following is the example of Logical Operators :


  In Python we can write comments initializing with ' # '

Comments

Popular posts from this blog

Introduction to Python Programming

Lists in Python

Variables in Python.