5 Dec 2020

Logical Operators

           Logical operators are the and, or, not operators.

             


 Example :   

a = True
b = False
print('a and b is',a and b)
print('a or b is',a or b)
print('not a is',not a)

Output:
x and y is false
x or y is true
not x is false

No comments:

Post a Comment

Operator precedence

           When an expression contains more than one operator, the order of evaluation depends on the order of operations.            The ac...