<jupyter_start><jupyter_text>Welcome to Python FundamentalsIn this module, we aregoing to establish our skills in Python programming. In this notebook we are going to cover:*   Variables and data Types*   Operation*   Input and Ouput Operation*   Logic Control*   Interables*   Functions  Variables and Data TypesVariables and data types are the values that change in Python, as the name implies. A variable is a memory location where you store a value in a programming language. According to the requirements, the value you've saved may change in the future.<jupyter_code>x = 1
a, b = 1, -2
b
type (x)
y = 3.0
type (y)
x = float(x)
type(x)
x
s, t, u = "1", "3", 'three'
type(u)<jupyter_output><empty_output><jupyter_text>Operation ArithmeticAddition (+), subtraction (-), multiplication (), division (/), exponent (*), floor division (//), and modulus are the arithmetic operators ( percent ). The first four are quite straightforward: addition, subtraction, multiplication, and division, all of which you should be familiar with.<jupyter_code>w, x, y, z = 4.0, -3.0, 2, -32
### Addition 
S = w + x
### Subtraction
D = y - z
### Multiplication
P = w*z
### Division
Q = y/x
Q
### Floor Division
Qf = w//z
Qf
### Exponentiation
E = w**w
E
### Modulo
mod = z%x
mod<jupyter_output><empty_output><jupyter_text>Assignment OperationsAssignment Operators give a variable a specific value. The one that is most commonly used is =. Simply type the name of the variable you want to assign a new value to, the =, and the value you want to assign to it to utilize it.The assignment operators operate are the following:*   *=*   /=*   **=*   //=*   %=<jupyter_code>A, B, C, D, E = 0, 100, 2, 1, 2
A += w
A
B -= x
B
C *= w
C
D /= x
D
E **= y
E<jupyter_output><empty_output><jupyter_text>ComparatorsYou can use comparison operators to compare the values of variables, as you might expect. They will always return a boolean value of True or False. There are a total of six of them:*   Equal: ==*   Not equal: !=*   Greater than: >*  Less than: <*   Greater than or equal: >=*   Less than or equal: <=<jupyter_code>size_1, size_2, size_3 = 1, 2.0,"1"
true_size = 1.0
## Equality
size_2 != true_size
## Non - Equality
s1 = size_1 > size_2
s2 = size_1 < size_2/2
true_size >= size_1
size_2 <= true_size<jupyter_output><empty_output><jupyter_text>LogicalThese may be recognizable to you already! They're known as logical connectives in logic. These are also commonly employed in human speech. They are as follows: and, or, and not.Only True if both operands (the two boolean objects you're comparing) are True. Consider the following scenario:<jupyter_code>size_1 == true_size
size_1 is true_size
size_1 is not true_size
P, Q = True, False
conj = P and Q
conj 
disj = P or Q
disj
nand = not(P and Q)
nand
xor = (not P and Q) or (P and not Q)
xor<jupyter_output><empty_output><jupyter_text>Input and Output<jupyter_code>print("Hello World")
cnt = 14000
string = "Hello World!"
print(string, ", Current COVID count is: {cnt}")
cnt += 1000
print(f"{string}, current count is: {cnt}")
sem_grade = 86.25
name ="Jamella"
print("Hello{}, your semestral grade is :{}" . format(name, sem_grade))
pg, mg, fg = 0.3, 0.3, 0.4
print("The weights of your semestral grades are:\
\n\t {:.2%} for Prelims\
\n\t {:.2%} for Midterms, and\
\n\t\ {:.2%} for Finals.".format(pg, mg, fg))
e = input("Enter a number:1")
name = input("Enter your name: ")
pg = input("Enter prelim grade: ")
mg = input("Enter midterm grade: ")
fg = input("Enter final grade: ")
sem_grade = None
print("Hello{}, your semestral grade is: {}".format(name, sem_grade))<jupyter_output><empty_output><jupyter_text>Looping Statements While<jupyter_code>## while loops
i, j = 0, 10
while(i<=j):
  print(f"{i}\t|\t{j}")
  i +=1<jupyter_output><empty_output><jupyter_text>For<jupyter_code># for(int = 0); i<10; i++){
# printf(i)
# }

i = 0
for i in range(11):
  print(i)
  
playlist = ["Bahay Kubo", "Magandang Kanta", "Buko"]
print('Now Playing:\n')
for song in playlist:
  print(song)
  
num_1, num_2 = 14, 12
if(num_1 == num_2):
  print("HAHA")
elif(num_1>num_2):
    print("HOHO")
else:
  print("HUHU")<jupyter_output><empty_output><jupyter_text>Functions<jupyter_code># void DeleteUser {int userid}{
# delete(userid);
#}

def delete_user (userid):
  print("Succesfully deleted user {}". format(userid))
userid = 2020_100100
delete_user(2020_100100)
added1, added2 = 5, 6
def add(added1, added2):
  sum =added1 +added2
  return sum

add(5, 4)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1310237619364868, 'fraction_numerical': 0.025760604041749943, 'mean_word_length': 4.672544080604534, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 42, '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': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '549206', 'license': 'Apache-2.0', 'n_tokens_mistral': 1681, 'n_tokens_neox': 1587, 'n_words': 567, 'path': 'Assignment2.ipynb', 'repo_name': 'jamellasagelliv/linearpubfiles2021', 'size': '4503'}