<jupyter_start><jupyter_text>Welcome to Python FundamentalsIn this module, we are going to establish or review 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  Variable and Data Types<jupyter_code>x = 420
a,b = 1337, 69
type(x)
y = 1.0
type(y)
x = float(x)
type (x)
s,t,u = "0", '1', 'one'
type(u)
s_int = int(s)
s_int
type(s)<jupyter_output><empty_output><jupyter_text>Operations  Arithmetic<jupyter_code>l,m,n,o = 2.0,3,0,-64
# Addition
S = l+m
S
# Subtraction
D = m-o
D
# Multiplication

P = l*o
P
# Division
Q = n/l
Q
# Floor Division
Fq = l//m
Fq
# Exponentiation

E = l**m
E
# Modulo
mod = o%m
mod<jupyter_output><empty_output><jupyter_text>Assignment Operations<jupyter_code>G,H,J,K = 0, 100, 2, 2
G += l
G
H -= o
H
J *= 2
J
K **= 3
K<jupyter_output><empty_output><jupyter_text>Comparators<jupyter_code>res_1, res_2, res_3 = 1,2.0,"1"
true_val =1.0
## Equality
res_1 == true_val
## Non-equality
res_2 != true_val
## Inequality
t1 = res_1 > res_2
t2 = res_1 < res_2/2
t3 = res_1 >= res_2/2
t4 = res_1 <= res_2
t1<jupyter_output><empty_output><jupyter_text>Logical<jupyter_code>res_1 == true_val
res_1 is true_val
res_1 is not true_val
p,q = True, False
conj = p and q
conj
p, q = True, False
disj = p or q
disj
p, q = True, False
nand = not(p and q)
nand
p, q = True, False
xor = (not p and q) or (p and not q)
xor<jupyter_output><empty_output><jupyter_text>I/O<jupyter_code>print("Hello World")
cnt = 1
string = "Hello World"
print (string, ", Current run count is:", cnt)
cnt += 1
print(f"{string}, Current count is: {cnt}")
sem_grade = 82.243564657746123
name = "Janus"
print("Hello {}, your semestral grade is: {}".format(name, sem_grade))
w_pg, w_mg, w_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(w_pg, w_mg, w_fg))
x = input("enter a number: ")
x
name = input("Kimi no nawa: ")
pg = input("Enter Prelim Grade: ")
mg = input("Enter Midterm Grade: ")
fg = input("Enter Finals Grade: ")
sem_grade = 90


print("Hello {}, your semestral grade is: {}".format(name, sem_grade))<jupyter_output>Kimi no nawa: janus
Enter Prelim Grade: 60
Enter Midterm Grade: 59
Enter Finals Grade: 70
Hello janus, your semestral grade is: 90<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>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 i=0, i<10; i++){
# printf(i)
# }

i=0
for i in range(11):
  print(i)
playlist = ["Crazier", "Bahay-Kubo", "Happier"]
print('Now Playing:\n')
for song in playlist:
  print(song)<jupyter_output>Now Playing:

Crazier
Bahay-Kubo
Happier<jupyter_text>Flow Control Condition Statements<jupyter_code>numeral1, numeral2 = 15, 12
if(numeral1 == numeral2):
  print("Hello")
elif(numeral1>numeral2):
  print("GoodBye")
else:
  print("Haha")
print("Hep Hep")<jupyter_output>GoodBye
Hep Hep<jupyter_text>Functions<jupyter_code># void DeleteUser(int userid){
#   delete(userid);
# }

def delete_user (userid):
  print("Successfully deleted user: {}".format(userid))

def delete_all_users ():
  print("Successfully deleted all users")
userid = 202011309
delete_user(202011309)
delete_all_users()
def add(addend1, addend2):
  print("Magaling ako mag add")
  return addend1 + addend2

def power_of_base2(exponent):
  return 2**exponent

addend1 = 420
addend2 = 69

exponent = 10

add(addend1, addend2)
power_of_base2(exponent)<jupyter_output>Magaling ako mag add<jupyter_text>Lambda Functions<jupyter_code>...
Create a grade calculator that computes for the semestral grade of a course.
Students could type their names, the name of the course, then their prelim, midterm, and final grade.
The program should print the semestral grade in 2 decimal points and should displayt the folowign emojis depending on the situation:
happy - when grade is greater than 70.00
laughing - when grade is exactly 70.00
sad - when grade is below 70.00
...

happy, sad, lol = "\U0001F600", "\U0001F606", "\U0001F62D"<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13378952336007552, 'fraction_numerical': 0.0512033978291647, 'mean_word_length': 5.099280575539568, 'pattern_counts': {'":': 0, '<': 44, '<?xml version=': 0, '>': 43, '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': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '468258', 'license': 'Apache-2.0', 'n_tokens_mistral': 1874, 'n_tokens_neox': 1732, 'n_words': 493, 'path': 'Activity_1_Python_Fundamentals.ipynb', 'repo_name': 'Janoose/Linear-Algebra_ChE_2nd-Sem-2021-2022', 'size': '4238'}