0% found this document useful (0 votes)
22 views

Introduction To Operators

Operators are symbols that represent mathematical or logical tasks. There are arithmetic, comparison, and logical operators. Arithmetic operators include addition, subtraction, multiplication, division, modulo, floor division, and exponent. Comparison operators compare values. Logical operators combine conditional statements.

Uploaded by

viswa teja
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Introduction To Operators

Operators are symbols that represent mathematical or logical tasks. There are arithmetic, comparison, and logical operators. Arithmetic operators include addition, subtraction, multiplication, division, modulo, floor division, and exponent. Comparison operators compare values. Logical operators combine conditional statements.

Uploaded by

viswa teja
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Operators

Operators
Task Symbol

● What are Operators?


Addition +

Subtraction -
● Symbols that represent mathematical or logical tasks.

Multiplication *

3+5 Division /

Operands Operator
Different Types of Operators

Operators

Arithmetic Operators Comparison Operators Logical Operators


Different Types of Operators

Arithmetic Operators

• Addition +

• Subtraction –

• Multiplication *

• Division /

• Modulo %

• Floor division //

• Exponent **
Different Types of Operators

Arithmetic Operators
Addition -> 3 + 5 + 6 = 14
• Addition +
Subtraction -> 6 - 4 - 2 = 0
• Subtraction –

• Multiplication *

• Division /

• Modulo %

• Floor division //

• Exponent **
Different Types of Operators

Arithmetic Operators
Addition -> 3 + 5 + 6 = 14
• Addition +
Subtraction -> 6 - 4 - 2 = 0
• Subtraction –
Multiplication -> 3 * 5 * 6 = 90
• Multiplication *
Division -> 5 / 3 = 1.67
• Division /

• Modulo %

• Floor division //

• Exponent **
Different Types of Operators

Arithmetic Operators
Addition -> 3 + 5 + 6 = 14
• Addition +
Subtraction -> 6 - 4 - 2 = 0
• Subtraction –
Multiplication -> 3 * 5 * 6 = 90
• Multiplication *
Division -> 5 / 3 = 1.67
• Division /
Modulo -> 5 % 3 =2
• Modulo %
Floor Division -> 5 // 3 =1
• Floor division //

• Exponent **
Different Types of Operators

Arithmetic Operators
Addition -> 3 + 5 + 6 = 14
• Addition +
Subtraction -> 6 - 4 - 2 = 0
• Subtraction –
Multiplication -> 3 * 5 * 6 = 90
• Multiplication *
Division -> 5 / 3 = 1.67
• Division /
Modulo -> 5 % 3 =2
• Modulo %
Floor Division -> 5 // 3 =1
• Floor division //
Exponent -> 5 ** 3 = 125
• Exponent **
Different Types of Operators

Comparison Operators

• Less than <

• Less than or Equal to <=

• Equal to ==

• Greater than >

• Greater than or equal to >=

• Not equal to !=
Different Types of Operators
x y
Comparison Operators Less than -> x < y -> ? 3 5

• Less than <

• Less than or Equal to <=

• Equal to ==

• Greater than >

• Greater than or equal to >=

• Not equal to !=
Different Types of Operators
x y
Comparison Operators Less than -> x < y -> True! 3 5

• Less than <

• Less than or Equal to <=

• Equal to ==

• Greater than >

• Greater than or equal to >=

• Not equal to !=
Different Types of Operators
x y
Comparison Operators Less than -> x < y -> ? 17 5

• Less than <

• Less than or Equal to <=

• Equal to ==

• Greater than >

• Greater than or equal to >=

• Not equal to !=
Different Types of Operators
x y
Comparison Operators Less than -> x < y -> False 17 5

• Less than <

• Less than or Equal to <=

• Equal to ==

• Greater than >

• Greater than or equal to >=

• Not equal to !=
Different Types of Operators
x y
Comparison Operators Less than -> x < y 17 5

• Less than < Less than or equal to -> x <= y

• Less than or Equal to <= Equal to -> x == y

• Equal to ==

• Greater than >

• Greater than or equal to >=

• Not equal to !=
Different Types of Operators
x y
Comparison Operators Less than -> x < y 17 5

• Less than < Less than or equal to -> x <= y

• Less than or Equal to <= Equal to -> x == y

• Equal to ==

• Greater than > Greater than -> x > y

• Greater than or equal to >= Greater than or equal to -> x <= y

• Not equal to != Not Equal to -> x != y


Different Types of Operators

Logical
Logical
Operators
Operator

• and

• or

• not
Different Types of Operators

Logical
Logical
Operators
Operator and -> True only if both comparisons are True.

• and

• or

• not
Different Types of Operators
x y

and -> True only if both comparisons are True. 3 7


Logical
Logical
Operators
Operator
x < 5 and y > 8 --> ?
• and

• or

• not
Different Types of Operators
x y

and -> True only if both comparisons are True. 3 7


Logical
Logical
Operators
Operator
x < 5 and y > 8 --> True and False
• and

• or

• not
Different Types of Operators
x y

and -> True only if both comparisons are True. 3 7


Logical
Logical
Operators
Operator
x < 5 and y > 8 --> True and False --> False
• and

• or

• not
Different Types of Operators
x y

and -> True only if both comparisons are True. 3 7


Logical
Logical
Operators
Operator
x < 5 and y > 8 --> True and False --> False
• and
or -> True if either of the comparisons are True.
• or
x < 5 or y > 8 --> True or False
• not
Different Types of Operators
x y

and -> True only if both comparisons are True. 3 7


Logical
Logical
Operators
Operator
x < 5 and y > 8 --> True and False --> False
• and
or -> True if either of the comparisons are True.
• or
x < 5 or y > 8 --> True or False --> True
• not
Different Types of Operators
x y

and -> True only if both comparisons are True. 3 7


Logical
Logical
Operators
Operator
x < 5 and y > 8 --> True and False --> False
• and
or -> True if either of the comparisons are True.
• or
x < 5 or y > 8 --> True or False --> True
• not
not -> True if comparison is False and vice-versa.

not x < 5 --> not True


Different Types of Operators
x y

and -> True only if both comparisons are True. 3 7


Logical
Logical
Operators
Operator
x < 5 and y > 8 --> True and False --> False
• and
or -> True if either of the comparisons are True.
• or
x < 5 or y > 8 --> True or False --> True
• not
not -> True if comparison is False and vice-versa.

not x < 5 --> not True --> False


Summary

Arithmetic Operators
Comparison Operators
Logical
Logical
Operators
Operator
• Addition +
• Less than <
• Subtraction – • and
• Less than or Equal to <=
• Multiplication * • or
• Equal to ==
• Division / • not
• Greater than >
• Modulo %
• Greater than or equal to >=
• Floor division //
• Not equal to !=
• Exponent **
Thank You

You might also like