<jupyter_start><jupyter_text>Arithmetic Operators<jupyter_code># addition +
# Subtraction -
# Multiplication *
# Division /
# Modulus %
# Floor Division //
# Exponent **
# Add
1+2+3
# Sub
30-4
#Multi
34*4
#Division
30/2
#Modulus #Reminder of a division
10%4
#Floor Division
10//4
#Exponent
2**4
x = 5
y = 10
print("x + y =",x+y)
print("x - y =",x-y)
print("x * y =",x*y)
print("x / y =",x/y)
print("x % y =",x%y)
print("x // y =",x//y)
print("x ** y =",x**y)<jupyter_output>x + y = 15
x - y = -5
x * y = 50
x / y = 0.5
x % y = 5
x // y = 0
x ** y = 9765625<jupyter_text>Comparison operations<jupyter_code>#Greater than >
#Less than <
#Equal to ==
#Not equal to !=
#Greater than or equal to >=
#Less than or equal to <=
x = 10
y = 15
x>y
x<y
x==y
x!=y
x>=y
x<=y<jupyter_output><empty_output><jupyter_text>Logical Operators<jupyter_code># and
# or
# not
a = False
b = True

print("a and b is ", a and b)
print("a or b is ", a or b)
print("not a is ", not a)
1 and 0
1 and 1
True and True
False and True
False and False
True or False
1 or 0
not 0
not 1<jupyter_output><empty_output><jupyter_text>Assignment operations<jupyter_code># Used to assing values
x = 10
x
x+=5 #adding to original variable

x
x-=10
x
x/=5
x<jupyter_output><empty_output><jupyter_text>Identity Operators<jupyter_code>#is
#is not
x = 5
y = 10

print(x is not y)
print(x is y)<jupyter_output>True
False<jupyter_text>Membership Operators<jupyter_code>#in
#not in
x = "<NAME>"
y = [1, 2, 3, 4]

print("H" in x)
print(1 in y)
print("t" not in x)
print(2 not in y)
print(bool(-3))
a = [10, 20]
b = a
a
b
b += [30,40]
b
a
####
x = 100
y = 50
print(x and y) #In Python, When we join two non-Boolean values using a and operator, 
               #the value of the expression is the second operands, not True or False.
print(2 * 3 ** 3 * 4) #exponencial is first
print(2%6)<jupyter_output>2
{'fraction_non_alphanumeric': 0.15567567567567567, 'fraction_numerical': 0.047027027027027025, 'mean_word_length': 3.8968253968253967, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '613466', 'license': 'MIT', 'n_tokens_mistral': 862, 'n_tokens_neox': 806, 'n_words': 264, 'path': 'python/sde-octopus course/Computations and perform operations.ipynb', 'repo_name': 'natan-dias/study', 'size': '1852'}