& and or operatoras python code example

Example 1: x and y in python

x = 10
y = 12

# Output: x > y is False
print('x > y is',x>y)

# Output: x < y is True
print('x < y is',x<y)

# Output: x == y is False
print('x == y is',x==y)

# Output: x != y is True
print('x != y is',x!=y)

# Output: x >= y is False
print('x >= y is',x>=y)

# Output: x <= y is True
print('x <= y is',x<=y)

Example 2: //= python meaning

#Performs floor-division on the values on either side. Then assigns it to the expression on the left.
>>> a=6
>>> a//=3
>>> print(a)
2