#ottit
Logical Operators in Python | and , or , not | Python Tutorial for Beginners in telugu step by step Part 6
1. cond1 and cond2
Returns true only when the given both conditions returns true
2. cond1 or cond2
Returns true when any of the given condition is true
3.not cond
Reverses or returns opposite of the result of the given condition
Supermarket - discount example
a. customer is member?
b. customer is with membership card?
c. customer is not a member?
and:
if customer is member? and customer is with valid membership card? then
issue 20% discount
or:
if customer is member? or customer is with valid membership card? then
issue 10% discount
not:
if customer is not a member? then
issue 0% discount
price = 80
price less than 100 and price less than 90
true and true = true
price less than 100 or price less than 70
true or false = true
not price less than 70
not false = true
not price greater than 70
not true = false