<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>s=55 
po, pu = 25, 29
po
type(s)
y=1.0
type(y)
x= float(s)
type(s)
g,h,f = "0", '1', 'one'
type(g)
s_int = int(g)
s_int<jupyter_output><empty_output><jupyter_text>Operations Arithmetic<jupyter_code>a,b,c,d = 5.1, 1, 99, 100
# Addition
S = a+b+c
S
### Substraction
F = a-b-d
F
### Multiplication
Q = a*b*c
Q
### Division
B = a/a+b
B
#### Floor division
Fd = d//a
Fd
### Exponentation
E = a**d
E
### Modulo
mod= b%d
mod<jupyter_output><empty_output><jupyter_text>Assignment Operations<jupyter_code>Z, X, C, V = 500, 800, 700, 900
Z +=Z
Z
X -= X
X
C *= 2
C
V **= 3
V<jupyter_output><empty_output><jupyter_text>Comparators<jupyter_code>res_1, res_2, res_3 = 6.0, 2.0, "1"
true_val = 8.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
t3<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
disj = p or q
disj
p,q = True, False
conj = p and q
conj
p,q = True, False
nand = not(p and q)
nand
p,q = True, False
xor = (not p and q) or (q and not q)
xor<jupyter_output><empty_output><jupyter_text>I/O<jupyter_code>print ("Tamad ako")
cnt = 300
string = "Nakakatamad"
print(string, ", Current run count is:", cnt)
cnt += 1
print(f"(string), Current count is: 2 (cnt)")
sem_grade = 6.9
name = "Kenneth"
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("What's your favorite number")
x
name = input("Your name: ")
pg = input("Nangangamoy bagsak, prelim grade: ")
mg = input("Nangangamoy bagsak, midterm grade: ")
fg = input("Nangangamoy bagsak, final grade: ")
sem_grade = 0
print("Hello {}, your semestral grade is: {}" .format(name, sem_grade))<jupyter_output>Your name: Ken
Nangangamoy bagsak, prelim grade: 10
Nangangamoy bagsak, midterm grade: 20
Nangangamoy bagsak, final grade: 30
Hello Ken, your semestral grade is: 0<jupyter_text>While<jupyter_code>## while loops
chismosa, marites = 0, 10
while(chismosa<=marites):
  print(f"{chismosa}\t|{marites}")
  chismosa+=1
# for(int marites=0; marites<10; marites++){
# printf(marites)
# }

marites=0
for marites in range(10):
  print(marites)
playlist = ["Alpha chismosa", "Paro-paro G", "<NAME>"]
print('TikTok playlist:\n')
for song in playlist:
  print(song)<jupyter_output>TikTok playlist:

Alpha chismosa
Paro-paro G
mar<NAME><jupyter_text>Flow Control Conditon Statements<jupyter_code>numeral1, numeral2 = 12, 14
if(numeral1 == numeral2):
  print("yooo")
elif(numeral1>numeral2):
  print("edi wew")
else:
  print("edi wow")
# 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 = 20201234
delete_user(20201234)
delete_all_users()
def add(addend1, addend2):
  print("I know and I know")
  return addend1 + addend2

def power_of_base2(exponent):
    return 2**exponent

addend1 = 10
addend2 = 10

add(addend1, addend2)

exponent = 5

#add(addend1, addend2)
power_of_base2(exponent)
add(addend1, addend2)<jupyter_output><empty_output><jupyter_text>Activity<jupyter_code>name = input("Enter your name: ")
coursename = input("Enter your course: ")

print("\nLet's compute for your semestral grade!")

 
prelims = input("\nPrelim Grade: ")
midterms = input("Midterm Grade: ")
finals = input("Finals Grade:")

prelims = float(prelims)
midterms = float(midterms)
finals = float(finals)

## Weighted grades

prelims_w = prelims * 0.3
midterms_w = midterms * 0.3
finals_w = finals * 0.4

sem_grade = (prelims_w + midterms_w + finals_w)

sem_grade_percent = sem_grade / 100


passing_grade = 70

if (sem_grade == passing_grade):
    print("\nHi {}, your semestral grade is: {:.2%}, \U0001F606 ". format(name, sem_grade_percent))
elif (sem_grade > passing_grade):
    print("\nHi {}, your semestral grade is: {:.2%}, \U0001F600 ". format(name, sem_grade_percent))
else:
    print("\nHi {}, your semestral grade is: {:.2%}, \U0001F62D ". format(name, sem_grade_percent))<jupyter_output>Enter your name: Ken
Enter your course: ChE

Let's compute for your semestral grade!

Prelim Grade: 70
Midterm Grade: 70
Finals Grade:80

Hi Ken, your semestral grade is: 74.00%, 😀
{'fraction_non_alphanumeric': 0.14264919941775836, 'fraction_numerical': 0.03867747972551466, 'mean_word_length': 5.295811518324608, 'pattern_counts': {'":': 0, '<': 40, '<?xml version=': 0, '>': 40, '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': '388338', 'license': 'Apache-2.0', 'n_tokens_mistral': 2073, 'n_tokens_neox': 1925, 'n_words': 519, 'path': 'Activity_1_Pyton_Fundamentals.ipynb', 'repo_name': 'paulkennethjazul/Linear_Algebra_ChE_2nd_Sem_2021-2022', 'size': '4824'}