<jupyter_start><jupyter_text>Operators  Types of Operators in Python:1. Arithmetic operators2. Assignment operators3. Comparison operators4. Logical operators5. Identity operators6. Membership operators7. Bitwise operators  Arithmetic Operators |Operator|Meaning       ||:------:|-------------:||1. +    |Addition      | |2. -    |Subtraction   ||3. *    |Multiplication||4. /    |Division      ||5. %    |Modulus       ||6. **   |Exponentiation||7. //   |Floor Division|<jupyter_code>print("Addition ",5+7)     
print("Subtraction ",10 - 3)  
print("Multiplication ",8*7)    
print('Division ', 8/7)     
print('Floor division or Integer divison ',8 // 7)  
print('Modulus ',31%4)    
print('Exponentiation ',2**3)<jupyter_output>Addition  12
Subtraction  7
Multiplication  56
Division  1.1428571428571428
Floor division or Integer divison  1
Modulus  3
Exponentiation  8<jupyter_text>Assignment Operators |Expression |Equivalent  ||:----------|-----------:||1. x=2     |x = 2       | |2. x+=2	|x = x+2     ||3. x-=2    |x = x - 2   ||4. x*=2    |x = x * 2   ||5. x/=2    |x = x / 2	 ||6. x%=2    |x = x % 2	 ||7. x//=2   |x = x //2   ||8. x**=2   |x = x ** 2  ||9. x&=2    |x = x & 2   ||10. x\|=2  |x = x \| 2  ||11. x^=2   |x = x ^ 2   ||12. x>>=2  |x = x >> 2  ||13. x<<=2  |x = x << 2  |<jupyter_code>x=10     # x = 1010(base 2)
x<<=2    # 00001010(10) -> 00101000(40)
print(x)<jupyter_output>40<jupyter_text>Comparison Operators |Operator   |Meaning                  ||:----------|:-----------------------:||1. ==      | Equal                   | |2. !=      | Not Equal               ||3. >       | Greater than            ||4. <       | Lesser than             ||5. >=      | Greater than OR Equal to||6. <=      | Lesser than OR Equal to | **import math**import: The import keyword is used to import other modules into a Python script.math: This module provides access to the mathematical functions defined by the C standard.We use the import keyword to import the math module into the namespace of our script. We can then use the functions defined in module using math.function_name(arg(s)) and the mathematical constants by math.constant_nameHere we are using math.pi and math.e to reference to the values of the mathematical constants 3.1416.. and 2.71..<jupyter_code>import math
print(5==5)
print(7<=3)
print("beagel"=="bagel")
print(math.pi > math.e) #3.141.. > 2.718..<jupyter_output>True
False
False
True<jupyter_text>Logical Operators |Operator    |Meaning                    ||:-----------|:-------------------------:||1. and      | both statements T         | |2. or       | Either or Both statement T||2. not      | Reverses Statement        |<jupyter_code>print(1 and True) # 1 = True; 0 = False
print(True or 0)
print(not False)<jupyter_output>True
True
True<jupyter_text>Identity Operators |Operator    |Meaning                       ||:-----------|:----------------------------:||1. is       | Both vars are same object    | |2. is not   | Both vars are not same object|<jupyter_code>x,y,z = 5,5,10
print(x is x)
print(x is y)
print(x is z)
print(x is not y)<jupyter_output>True
True
False
False<jupyter_text>Membership Operators |Operator    |Meaning                       ||:-----------|:----------------------------:||1. in       | value present in sequence    | |2. not in   | value absent in sequence     |<jupyter_code>list1 = [1,3,2,4,5,6,2,22,[3,4,5]]
x,y,z,t = 3,99,[2,4,5],[3,4,5]
print(x in list1)
print(y in list1)
print(z in list1)
print(t in list1)
print(y not in list1)<jupyter_output>True
False
False
True
True<jupyter_text>Bitwise Operators |Operator   |Meaning                               ||:----------|:------------------------------------:||1. &       | AND (BOTH 1)                         | |2. \|      |OR(EITHER OR BOTH 1)                  ||3. ^       |XOR(EITHER 1)                         ||4. ~       |NOT(REVERSE BIT)                      ||5. >>      |SIGNED SHIFT RIGHT(PUSH 0s FROM LEFT) ||6. <<      |SIGNED SHIFT LEFT(PUSH 0s FROM RIGHT) |<jupyter_code>print(1 & 1) 
print((1&1)^(1&0)) # 1 XOR 0
print(6>>2) # 110 -> 001<jupyter_output>1
1
1<jupyter_text>Control Statments  Conditional statement: if elif else  Syntax:if (condition):>statements  elif (condition):>statements    ..elif (condition):>statements else:>statements<jupyter_code>a,b = 22,22
if b > a:
  print("b is greater than a")
elif a == b:
  print("a and b are equal")
else:
  print("a is greater than b")<jupyter_output>a and b are equal<jupyter_text>Looping Statements 1. **for** 1. for in 2. for else2. **while** 1. while 2. while else  Control Statements: 1. **break**: It brings control out of the loop2. **continue**: It returns the control to the beginning of the loop3. **pass**: We use pass statement to write empty loops  for loop **for in:**     for iterator_var in sequence:>statements---**for else**for iterator_var in sequence:>statementselse: >statements<jupyter_code>fruits = ["apple", "banana", "cherry"]
for x in fruits:
  print(x)
  if x == "banana":
    break
for x in [0, 1, 2]:
  pass
print('loop over')
for x in range(4):
  print(x)
else:
  print("Finally finished!")<jupyter_output>0
1
2
3
Finally finished!<jupyter_text>while loop **while**while expression:>statement---**while else**while expression:>statementelse:>statement<jupyter_code>i = 0
while i < 6:
  i += 1
  if i == 3:
    continue
  print(i)
i = 1
while i < 6:
  print(i)
  i += 1
else:
  print("i is no longer less than 6")<jupyter_output>1
2
3
4
5
i is no longer less than 6
{'fraction_non_alphanumeric': 0.17978142076502732, 'fraction_numerical': 0.047540983606557376, 'mean_word_length': 2.4491206030150754, 'pattern_counts': {'":': 1, '<': 44, '<?xml version=': 0, '>': 56, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '227121', 'license': 'MIT', 'n_tokens_mistral': 2009, 'n_tokens_neox': 1854, 'n_words': 587, 'path': 'python-numpy-basics/operators_and_conrol_statements.ipynb', 'repo_name': 'Reshmika-Nambiar/Intro_to_CV-1', 'size': '5490'}