0% found this document useful (0 votes)
20 views20 pages

Logical Operators: Unit - II

Uploaded by

Ravindranath
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)
20 views20 pages

Logical Operators: Unit - II

Uploaded by

Ravindranath
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/ 20

Logical Operators

Unit - II
What Are Logical Operators?
Operators are the simplest way to act on data, typically on
simple data types like integers, strings, and floats.
Mathematical Operators
Operators that perform mathematical functions, like adding
numbers together or assigning values to variables.
Logical Operators
Operators that perform logical operations, such as
comparing relative values, checking equality, checking set
membership, or evaluating combinations of other logical
operators.
Relational Operators
Operators that check the relationships between multiple
variables, such as checking if they are equal or if one is
greater than another.
Numeric Comparisons
Non-Numeric Equality Comparisons
Set Operators
Relational Operators in Python
Numeric Equality Comparisons
Relational Operators in Python
Numeric Value Comparisons
Relational Operators in Python
Non-Numeric Equality Comparisons
Relational Operators in Python
Set Operators
Relational Operators in Python
Operators in Action
Boolean Operators
Operators like “and” and “or” that act on pairs of boolean
(true or false) values, or that act on single boolean values,
like “not”.
And
An operator that acts on two boolean (true or false) values
and evaluates to “true” if and only if both are true.

Or
An operator that acts on two boolean (true or false) values
and evaluates to “true” if and only if at least one is true.
Boolean Operators
Not
An operator that acts on one boolean (true or false) value
and evaluates to the opposite value (false becomes true, true
becomes false).

Combining Boolean Operators


Boolean Operators in Python
And
Boolean Operators in Python
Or
Boolean Operators in Python
Not
Boolean Operators in Python
Combining Operators
Boolean Operators in Python
Simplifying Conditionals
Truth Tables
Tables that map out the results of a statement in boolean
logic (that is, using boolean operators) depending on the
values of the individual variables.
And, Or, and Not
Truth Tables
More Complex Truth Tables
Truth Tables
Properties of Boolean Operators
Truth Tables
Properties of Boolean Operators
Truth Tables
Properties of Boolean Operators

You might also like