<jupyter_start><jupyter_text>Welcome to Python Fundamentals In this module, we are going to establish our skills in Python programming. In this notebook we are going to cover:*   Variables and Data Types*   Operations*   Input and Output Operations*   Logic Control*   Interables*   Functions  Variable and Data TypesThe value specifies which operations can be performed on a given set of data. Because everything in Python programming is an object, data types are essentially classes, and variables are instances of these classes.<jupyter_code>x = 1
a, b = 3, -2

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>Operations  ArithmethicIs used to perform mathematical operations. Seven arithmetic operators for different mathematical operations.*   Addition (+)*   Subtraction (-)*   Multiplication (*)*   Division (/)*   Exponentiation (**)*   Floor division (//)*   Modulus (%)<jupyter_code>w, x, y, z = 4.0, -3.0, 1, -32 
### Adition 
S = w + x

### Subtraction 
D = y - z
### Multiplication 
p = w*z

### Division
Q = y/x

### Floor Division
Qf = w//z

### Exponentiation
E = w**w

### Modulo
mod = z%x<jupyter_output><empty_output><jupyter_text>Assignment OperationsAre used to assign values to variables in Python. The assignment operator a = 5 assigns the value 5 on the right to the left-hand variable.*   *=*   /=*   **=*   //=*   %=<jupyter_code>A, B, C, D, E = 0, 100, 2, 1, 2
A += w

B -= x

C *= w

D /= x

E **= y<jupyter_output><empty_output><jupyter_text>ComparatorsComparators are tools that allow two items to be compared. You'll make a comparator and use it to sort an array in this task.*   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_1 == true_size
## Non-Equality
size_2 != true_size
## Inequality 
s1 = size_1 > size_2
s2 = size_1 < size_2/2
s3 = true_size >= size_1
s4 = size_2 <= true_size<jupyter_output><empty_output><jupyter_text>Logical / Logic ControlAllows you to determine whether two expressions are True, the or logical operator determines whether one of many expressions is True, and the not operator determines whether an expression is False.<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

disj = P or Q
nand = not(P and Q)

xor = (not P and Q) or (P and not Q)<jupyter_output><empty_output><jupyter_text>Input and OutputInput refers to any information or data sent to the computer by the user via the keyboard. Output refers to the information that the computer provides to the user.<jupyter_code>print ("Hello World!")
cnt = 14000
string = "Hello World!"
print(string, ", Current COVID count is:", cnt)
cnt += 10000
print(f"{string}, current count is: {cnt}")
sem_grade = 86.25 
name = "Jobhert"
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:")

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>Enter your name: Jobhert
Enter prelim grade: 80
Enter midterm grade: 80
Enter final grade: 80
HelloJobhert, your semestral grade is: None<jupyter_text>Looping StatementsIs used to execute a block of statements or code numerous times according to the user's specifications.  While<jupyter_code>## While Loops
i, j = 0, 10
while(i<=j):
  print(f"{i}\t|\t{j}")
  i += 1<jupyter_output>0	|	10
1	|	10
2	|	10
3	|	10
4	|	10
5	|	10
6	|	10
7	|	10
8	|	10
9	|	10
10	|	10<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)<jupyter_output>Now Playing:

Bahay Kubo
Magandang Kanta
Buko<jupyter_text>Flow ControlIs the execution order of the program's code. Conditional statements, loops, and function calls govern the control flow of a Python program.  Conditional Statement<jupyter_code>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>HOHO<jupyter_text>Functions<jupyter_code># void DeleteUser (int userid){
# delete(userid);
#}

def delete_user (userid):
    print("Successfully deleted user: {}".format(userid))
userid = 2020_100100
delete_user = (2020_100100)
addend1, addend2, = 5, 6
def add(addend1, addend2):
    sum = addend1 + addend2
    return sum
add(5, 4)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12382700938392494, 'fraction_numerical': 0.032843737250102, 'mean_word_length': 4.490481522956327, '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': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '448537', 'license': 'Apache-2.0', 'n_tokens_mistral': 1857, 'n_tokens_neox': 1744, 'n_words': 610, 'path': 'Assignment2.ipynb', 'repo_name': 'Jobhert/Activity', 'size': '4902'}