Logical Operators

Lesson Progress
0% Complete

Logical operators are the and, or, not operators.

x = True
y = False
print('x and y is',x and y)
print('x or y is',x or y)
print('not x is',not x)

Logical Truth Table – (And)

print('Using Logical operator - "and"\n--')
print(f'True and False:= {True and False}')
print(f'True and True:= {True and True}')
print(f'False and True:= {False and True}')
print(f'False and False:= {False and False}')

Logical Truth Table – (Or)

print(f'True or False:= {True or False}')
print(f'True or True:= {True or True}')
print(f'False or True:= {False or True}')
print(f'False or False:= {False or False}')