<jupyter_start><jupyter_text>Welcome to Python Fundamentals---In this module, we are going to  establish our skills in Python porgramming. In this notebook we are going to cover:*   Variables and Data types*   operations*   Input and output operations*   Logic controls*   Iterables*   Functions Variables and Data Types [1] it represents the kind of value that tells what operations can be performed on a particular data. Since everything is an object in Python programming, data types are actually classes and variables are instance (object) of these classes. Following are the standard or built-in data type of Python: Numeric. Sequence Type.<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>Operation Arithmetic[1] The arithmetic operators in Python are used to perform math operations, such as addition, subtraction, multiplication, and division. Python also offers a number of libraries that enable you to perform more complex math tasks.<jupyter_code>w, x, y, z = 4.0, -3.0, 1, -32

### Addition
S = w + x
S
### Subtraction
D = y - z
D
### Multiplication
P= w*z
P
### Division
Q = y/x
Q
QF = w//z
QF
### Exponintiation
E = w**w
E
### Modulo
mod = z%x
mod<jupyter_output><empty_output><jupyter_text>Assignment[1] The assignment operators in Python are used to store data into a variable. = – assigns the value found in the right operands to the left operand.<jupyter_code>A, B, C, D= 0, 100, 2, 1
A += w
A 
B -= x
B
C *= w
C
D /= x
D
E **= y
E<jupyter_output><empty_output><jupyter_text>Comparators[2] Comparators are used to take two values and compare them together. It compares and produces the boolean values. It is commonly used with numerical values, but it can be used with other data types as well.<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 Operations[1] The logical operators in Python are used to combine the true or false values of variables (or expressions) so you can figure out their resultant truth value. Three logical operators are available in Python: "and", "or" and "not"<jupyter_code>size_1 == true_size
size_1 
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[3] Input : Any information or data sent to the computer from the user through the keyboard is called input. Output: The information produced by the computer to the user is called output. Python provides us with the two inbuilt functions as input() and output().<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 = "John"
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: jm
Enter Prelim grade: 80
Enter Midterm grade 80
Enter Final grade: 80
Hello jm, your semestral grade is: None<jupyter_text>Looping Statements[4] A loop statement allows us to execute a statement or group of statements multiple times. The following diagram illustrates a loop statement − Python programming language provides following types of loops to handle looping requirements.  While[5] Python While Loop is used to execute a block of statements repeatedly until a given condition is satisfied. And when the condition becomes false, the line immediately after the loop in the program is executed. While loop falls under the category of indefinite iteration.<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[6] A for loop in Python is a control flow statement that is used to repeatedly execute a group of statements as long as the condition is satisfied. Thus, a for loop is an iterative statement.<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")
# void Deleteuser (int userid){
# delete(userid);
#}

def delete_user (userid):
  print("Successfully 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><jupyter_text>References:[1] Python Course (2021).(https://geek-university.com/python)[2] The Secret of Comparators | Comparison Operators in Python (2021).(https://www.pythonpool.com/python-comparators/)[3] Python Input and Output Statements(2021).(https://chercher.tech/python-programming/python-inputs-and-outputs)[4] Python - Loops(2021).(https://www.tutorialspoint.com/python/python_loops.htm)[5] Python While Loop(2021).(https://www.geeksforgeeks.org/python-while-loop/)[6] For Loops in Python: Definition & Examples(2021).(https://study.com/academy/lesson/for-loops-in-python-definition-examples.html) ![image](https://upload.wikimedia.org/wikipedia/commons/thumb/0/0a/Python.svg/1024px-Python.svg.png)<jupyter_code><jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11375965806345553, 'fraction_numerical': 0.03353608416899556, 'mean_word_length': 4.739622641509434, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 38, 'https://': 7, 'lorem ipsum': 0, 'www.': 3, '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': '543001', 'license': 'Apache-2.0', 'n_tokens_mistral': 2176, 'n_tokens_neox': 2042, 'n_words': 766, 'path': 'Assignment2.ipynb', 'repo_name': 'JohnSingh18/LinearAlgebra2021-2022', 'size': '6083'}