11.operators in Python
11.operators in Python
Arithmetic Operators
Assignment Operators
Comparison Operators
Logical Operators
Identity Operators
Membership Operators
Bitwise Operators
0001
0010
0011
0100
0101
And so on.
Now I will give you a theoretical understanding of each of
these operators. There is no theory related difference in
them and the one we studied during school time. The only
difference you will see will be in the syntax i.e. how to
write them for perfect execution.
Arithmetic Operators:
Assignment Operators:
Comparison Operators:
Logical Operators:
Membership Operands:
Bitwise Operand:
# Arithmetic Operators
# print("5 + 6 is ", 5+6)
# print("5 - 6 is ", 5-6)
# print("5 * 6 is ", 5*6)
# print("5 / 6 is ", 5/6)
# print("5 ** 3 is ", 5**3)
# print("5 % 5 is ", 5%5)
# print("15 // 6 is ", 15//6)
# Assignment Operators
# print("Assignment Operators")
# x = 5
# print(x)
# x %=7 # x = x%7
# print(x)
# Comparison Operators
i = 5
# Logical Operators
a = True
b = False
# Identity Operators
# print(5 is not 5)
# Membership Operators
list = [3, 3,2, 2,39, 33, 35,32]
# print(324 not in list)
# Bitwise Operators
# 0 – 00
# 1 - 01
# 2 - 10
# 3 - 11
print(0 & 2)
print(0 | 3)