O
PERATORS
x = 27
y = 3
Python Assignment Operators
print(x + y)
x = 5
x <<= 3
print(x)
print(x)
print(x)
print(x)
print(x)
print(x)
print(x)
print(x)
print(x)
print(x)
print(x)
print(x)
x = 5
y = 3
print(x == y)
x = 5
print(x > 3 and x < 10)
x = ["apple", "banana"]
y = ["Apple", "banana"]
z = x print(x is z)
x = ["apple", "banana"]
print("banana" in x)
PERATORS
x = 27
y = 3
Python Assignment Operators
print(x + y)
30
print(x - y)
24
print(x * y)
81
print(x / y)
9.0
print(x % y)
0
print(x ** y)
19683
print(x // y)
9
Python Arithmetic Operatorsx = 5
x <<= 3
print(x)
40
x >>= 2 print(x)
10
x |= 3 print(x)
11
x &= 3 print(x)
3
x **= 3 print(x)
27
x //= 3 print(x)
9
x %= 3 print(x)
0
x /= 3 print(x)
0.0
x *= 3 print(x)
0.0
x -= 3 print(x)
-3.0
x += 3 print(x)
0.0
x = 5 print(x)
5
Python Comparison Operatorsx = 5
y = 3
print(x == y)
False
print(x != y)
True
print(x > y)
True
print(x < y)
False
print(x >= y)
True
print(x = y)
False
Python Logical Operatorsx = 5
print(x > 3 and x < 10)
True
print(x < 5 or x < 4)
False
print(not(x < 5 and x < 10))
True
Python Identity Operatorx = ["apple", "banana"]
y = ["Apple", "banana"]
z = x print(x is z)
True
print(x is not y)
True
print(x == y)
False
Python Membership Operatorsx = ["apple", "banana"]
print("banana" in x)
True
print("Banana" not in x)
True
Comments
Post a Comment