Header Ads

Responsive Ads Here

"and" and "or" Operator in Python

 "and" and "or" Operator in Python



num1 = 10
num2 = 20


if num1 == 10 and num2 == 20 and num1 < num2:
    print("Conditions are true.")
else:
    print("Conditions are false.")



if num1 == 20 or num2 == 30:
    print("Condition is true.")
else:
    print("Conditions are false.")



print(num1 == 5 and num2 == 20)

print(num1 == 10 or num2 == 30)

Powered by Blogger.