<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**   *Iterables**   *Functions*  ***Variables and Data Types***![image](https://static.javatpoint.com/python/images/python-data-types.png)> A variable in python is used in storing values or data in the program, the stored values or data may also be changed when the program is running. The values that are stored in the variable may come in different types and it is called as the Data Types, that specifies the type of value that determines which operations can be performed on a set of data [1]<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(s)<jupyter_output><empty_output><jupyter_text>**Operations**> *Operations are used to execute mathematic operation to a given data or variable and gives the result when the program is running*. [2]![image](https://www.creativefabrica.com/wp-content/uploads/2020/03/08/line-math-operations-icon-Graphics-3392758-1.jpg)  ***Arithmetic***> *are used to perform common mathematical operation such as addition, subtraction, multiplication and division.* [2]<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<jupyter_output><empty_output><jupyter_text>*A* **Floor Division** *is just like the usual division, the only difference between a floor division and division is that gives the largest integer.* [3]<jupyter_code>### Floor Division
Qf = w//z
Qf<jupyter_output><empty_output><jupyter_text>*A* **Exponentiation** *is also known as the power operator which raises an exponent to the given value or data.*<jupyter_code>### Exponentiation
E = w**w
E<jupyter_output><empty_output><jupyter_text>*In python the* **Modulo's** *symbol is % or percentage sign and is an operator that gives back the remainder of the two given variable or data that is divided with each other.* [4]<jupyter_code>### Modulo
mod = z%x
mod<jupyter_output><empty_output><jupyter_text>***Assignment***> *An operator that is used in assigning values to a variable or a data in the program.* [2]<jupyter_code>A, B, C, D, E = 0, 100, 2, 1, 2
A += w

B -= x
B
C *= w
C
D /= x
D

E **= y
E<jupyter_output><empty_output><jupyter_text>***Comparators***> *Is an operator that compares two variables or data and resulting to true or false.* [5]<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***> *an operator that uses is, is not, and, or in determining if the given variable is true or false.* [2]<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**> *are a function that connects the user to the program, Input allows the user to insert a variable or a function to a program, on the other hand, the output are the result of the input that the user made or printed in the program.*<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 = "Vincent"
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: ")
e
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**> *A statement wherein it executes a block of line or statement multiple time, until the condition the program or code is satisfied* [6]![image](https://www.codingninjas.com/blog/wp-content/uploads/2021/07/Blog-2021-07-26T124533.009.png) **While**> *A loop that executes a block of code multiple time as long as the condition or statement is true* [7]![image](https://files.realpython.com/media/Python-while-Loops-Indefinite-Iteration_Watermarked.ef0b89ed9dae.jpg)<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**> *For loops are used in iterating over a given sequence* [8]![image](https://files.realpython.com/media/Python-for-Loops-Definite-Iteration_Watermarked.b38126d495e1.jpg)<jupyter_code># for(int = 0; i<10; i++){
# printf(i)
# }

i = 0
for i in range (11):
  print(i)
playlist = ["<NAME>", "<NAME>", "Buko"]
print ('Now Playing:\n')
for song in playlist:
  print(song)<jupyter_output>Now Playing:

<NAME>
<NAME>
Buko<jupyter_text>**Flow Control**>  *The sequence in which statements or blocks of code are executed at runtime based on a condition is known as* **Flow Control**. [9]  Condition Statements<jupyter_code>num_1, num_2 = 12,13
if(num_1 == num_2):
  print("HAHA")
elif(num_1>num_2):
    print("HOHO")
else:
      print("HUHU")<jupyter_output>HUHU<jupyter_text>**Functions**> *A function is a block of code that runs only if it is called, returns data as an output of the program, and prevents code repetition.* [1]<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.13643685567010308, 'fraction_numerical': 0.0351159793814433, 'mean_word_length': 4.987463837994214, 'pattern_counts': {'":': 0, '<': 58, '<?xml version=': 0, '>': 69, 'https://': 5, 'lorem ipsum': 0, 'www.': 2, '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': '13', 'dir': 'jupyter-structured-clean-dedup', 'id': '384592', 'license': 'Apache-2.0', 'n_tokens_mistral': 2326, 'n_tokens_neox': 2191, 'n_words': 762, 'path': 'Assignment2_Natividad.ipynb', 'repo_name': 'vncntntvdd/LinearAlgebra21', 'size': '6234'}