<jupyter_start><jupyter_text>Operators Operators are special symbols in Python that carry out arithmetic or logical computation. The value that the operator operates on is called the operand.  Operator Types 1. Arithmetic operators    2. Comparison (Relational) operators3. Logical (Boolean) operators4. Bitwise operators5. Assignment operators6. Special operators  Arithmetic Operators Arithmetic operators are used to perform mathematical operations like addition, subtraction, multiplication etc.     + , -, *, /, %, //, **  are arithmetic operators Example:<jupyter_code>x,y = 3,2

#addition
print(x + y)

#subtraction(-)
print(x-y)

#multiplication(*)
print(x*y)
#division(/)

#modulo division (%)

#Floor Division (//)

#Exponent (**)<jupyter_output>30<jupyter_text>Comparision Operators Comparison operators are used to compare values. It either returns True or False according to the condition.     >, =, <= are comparision operators<jupyter_code>a, b = 10, 20         

print(a < b)  #check a is less than b

#check a is greater than b
print(a > b) 
#check a is equal to b
print(a == b) 
#check a is not equal to b (!=)
print(a != b) 
#check a greater than or equal to b
print(a >= b) 
#check a less than or equal to b
print(a <= b)<jupyter_output>True
False
False
True
False
True<jupyter_text>Logical Operators Logical operators are  **and, or, not** operators.<jupyter_code>a, b = True, False

#print a and b
print(a and b)

#print a or b
print(a or b)

#print not b
print(a and not b)<jupyter_output>False
True
True<jupyter_text>Bitwise operators Bitwise operators act on operands as if they were string of binary digits. It operates bit by bit     &,  |,  ~,  ^,  >>,  << are Bitwise operators<jupyter_code>a, b = 10, 4

#Bitwise AND
print(a & b)

#Bitwise OR
print( a | b)

#Bitwise NOT
print(~b)

#Bitwise XOR
print(a^b)

#Bitwise rightshift
print(a>>b)

#Bitwise Leftshift
print(a<<b)<jupyter_output>0
14
-5
14
0
160<jupyter_text>Assignment operators Assignment operators are used in Python to assign values to variables.a = 5 is a simple assignment operator that assigns the value 5 on the right to the variable a on the left.     =,  +=,  -=,  *=,  /=,  %=,  //=,  **=, &=,  |=,  ^=,  >>=,  <<= are Assignment operators<jupyter_code>a = 10

a += 10         #add AND
print(a)

#subtract AND (-=)
a -= 10
print(a)
#Multiply AND (*=)
a *= 10
print(a)
#Divide AND (/=)
a /= 10
print(a)
#Modulus AND (%=)
a %= 10
print(a)
#Floor Division (//=)
a //= 10
print(a)
#Exponent AND (**=)
a **= 10
print(a)<jupyter_output>20
10
100
10
0
0
0<jupyter_text>Special Operators  Identity Operators **is and is not** are the identity operators in Python. They are used to check if two values (or variables) are located on the same part of the memory.<jupyter_code>a = 5
b = 5
print(a is b)    #5 is object created once both a and b points to same object

#check is not
print( a is not b)
l1 = [1, 2, 3]
l2 = [1, 2, 3]
print(l1 is l2)
print(l1 == l2)
s1 = "Satish"
s2 = "Satish"
print(s1 is not s2)
print(s1 == s2)<jupyter_output>False
True<jupyter_text>MemberShip Operators **in and not in** are the membership operators in Python.     They are used to test whether a value or variable is found in a sequence (string, list, tuple, set and   dictionary).<jupyter_code>lst = [1, 2, 3, 4]
print(1 in lst)       #check 1 is present in a given list or not

#check 5 is present in a given list
print(5 in lst)
d = {1: "a", 2: "b"}
print(1 in d)<jupyter_output>True
{'fraction_non_alphanumeric': 0.11773213769164015, 'fraction_numerical': 0.025744865490309517, 'mean_word_length': 4.062957540263543, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '461300', 'license': 'MIT', 'n_tokens_mistral': 1306, 'n_tokens_neox': 1225, 'n_words': 473, 'path': '1_6.ipynb', 'repo_name': 'samyumobi/A-Complete-Python-Guide-For-Beginners', 'size': '3457'}