Logical Operations

# This script demonstrates the logical AND operation in Python

# Logical AND of booleans
a = True
b = False
result1 = a and b
print("Logical AND of", a, "and", b, "is:", result1)

# Logical AND with expressions
x = 10
y = 5
result2 = (x > 5) and (y < 10)
print("Logical AND of", (x > 5), "and", (y < 10), "is:", result2)
# This script demonstrates the logical OR operation in Python

# Logical OR of booleans
a = True
b = False
result1 = a or b
print("Logical OR of", a, "and", b, "is:", result1)

# Logical OR with expressions
x = 10
y = 5
result2 = (x > 5) or (y > 10)
print("Logical OR of", (x > 5), "and", (y > 10), "is:", result2)
# This script demonstrates the logical NOT operation in Python

# Logical NOT of booleans
a = True
result1 = not a
print("Logical NOT of", a, "is:", result1)

# Logical NOT with expressions
x = 10
result2 = not (x > 5)
print("Logical NOT of", (x > 5), "is:", result2)