0% found this document useful (0 votes)
10 views23 pages

Operators

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views23 pages

Operators

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

Operators

Operators

What is an Operator?
• An Operator is a character that represents a specific
mathematical or logical action or process.
• The values that an operator acts on are called operands.
• Some important operators programmers use :
• Arithmetic operator
• Assignment operator
• Logical operator
Operators

Types Of Operators:
o Arithmetic Operator
o Assignment Operator
o Comparison Operator
o Logical Operator
o Identity Operator
o Membership Operator
Operators

Arithmetic operator:
Arithmetic operators are used with numeric values to perform common
mathematical operations.
Operators

Arithmetic operator:
Operators

Example: Output:
Operators

Assignment operator:
o Assignment operator is used to assign the value, variable and function
to another variable.
Operators

Assignment operator:
Operators

Example: Output:
Operators

Comparison operator:
o Comparison operators are used to Compare two values.
o If the condition is true it returns true. Else, it returns false.
Operators

Comparison operator:
Operators

Example: Output:
Operators

Logical operator:
o Logical operators are used on conditional statements.
Operators

Logical AND operator:


o Logical and operator returns True if both the operands are True else it
returns False.
Example: Output:
Operators

Logical OR operator:
o Logical or operator returns True if either of the operands are True, else
it returns False.
Example: Output:
Operators

Logical NOT operator:


o Logical not operator works with single boolean value.
o If the boolean value is True it returns False and vice-versa.
Example: Output:
Operators

Identity operator:
o Identity operators are used to compare two object whether the objects
are same and share same memory location.
Operators

Identity is operator:
o Identity is operator evaluates to True if the variables on either side of
the operator point is the same objects. else, false.
Example: Output:
Operators

Identity is not operator:


o Identity is not operator evaluates to True if both variables are not same
the same objects. Else, False.
Example: Output:
Operators

Membership operator:
o Membership operators are used to test if a sequence is presented in an
object.
Operators

Membership in operator:
o The in operator is used to check is a character exists in a sequence or
not.
Example: Output:
Operators

Membership not in operator:


o The not in operator evaluates to true if it does not find a variable in the
specified sequence and false otherwise.
Example: Output:
Thank You

You might also like