<jupyter_start><jupyter_text><jupyter_code><jupyter_output><empty_output><jupyter_text>Hello world!  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 = 3
a,b = 0, -3
x
type(x)
y = 2.0
type(y)
x = float(x)
type(x)
s,t,u = "8", '4', 'four'
type(u)
s_int = int(s)
s_int<jupyter_output><empty_output><jupyter_text>Operation  Arithmetic<jupyter_code>m,a,r,k = 4.0, -1.0, 5.0, -15
# Addition
S = m+a
S
# Subtraction
D = r-k
D
# Multiplication
P = m*k
P
# Division
Q = r/m
Q
### Floor Division
Fq = m//a
Fq
### Exponentiation
t = m**a
t
### Modulo
mod = m%a
mod<jupyter_output><empty_output><jupyter_text>Assignment Operations<jupyter_code>L, U, N, A = 0, 31, 9, 9
L += r
L
U -= m
U
N *= 1
N
A **= 4
A<jupyter_output><empty_output><jupyter_text>Comparators<jupyter_code>res_1, res_2, res_3 = 3, 4.0, "9"
true_val = 2.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
t2<jupyter_output><empty_output><jupyter_text>Logical<jupyter_code>res_1 == true_val
res_1 is true_val
res_1 is not true_val
r, i = True, True
conj = r and i
conj
r, i = True, False
disj = r or i
disj

r, i = True, False
nand = not (r and i)
nand
r, i = True, False
xor = (not r and i) or (r and not i)
xor<jupyter_output><empty_output><jupyter_text>I/O<jupyter_code>print ("Hello Pilipens")
cnt = 2
string = "Hello Pilipens"
print(string, ", Current run count is:", cnt)
cnt += 2
print(f"{string} Current count is: {cnt}")
sem_grade = 1.0
name = "<NAME>"
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:\
\t\n{:.2%} for Prelims\
\n\t{:.2%} for Midterms, and\
\n\t{:.2%} for Finals.".format(w_pg, w_mg, w_fg))
x = input("input your name: ")
x
name = input("<NAME>: ")
pg = input("Enter prelim grade: ")
mg = input("Enter midterm grade: ")
fg = input("Enter finals grade: ")
sem_grade = 85
print("Hello {}, your semestral grade is: {}".format(name, sem_grade))<jupyter_output>Kimi no nawa: Rio Boy
Enter prelim grade: 85
Enter midterm grade: 84
Enter finals grade: 89
Hello Rio Boy, your semestral grade is: 85<jupyter_text>Looping Statements  While<jupyter_code>## while loops
c, o = 1, 25
while(c<=o):
  print(f"{c}\t|\t{o}")
  c+=1<jupyter_output>1	|	25
2	|	25
3	|	25
4	|	25
5	|	25
6	|	25
7	|	25
8	|	25
9	|	25
10	|	25
11	|	25
12	|	25
13	|	25
14	|	25
15	|	25
16	|	25
17	|	25
18	|	25
19	|	25
20	|	25
21	|	25
22	|	25
23	|	25
24	|	25
25	|	25<jupyter_text>For<jupyter_code># for(int c=1; c<25; c++){
    # print(c)
#}

c=1
for c in range(25):
  print(c)
playlist = ["Broke", "Mornin"]
print('Now Playing:\n')
for song in playlist:
  print(song)<jupyter_output>Now Playing:

Broke
Mornin<jupyter_text>Flow Control  Condition Statements<jupyter_code>numeral1, numeral2 = 9, 15
if(numeral1 == numeral2):
  print("Yey")
elif(numeral1>numeral2):
    print("Hiho")
else:
      print("Awit")
print("<NAME>")<jupyter_output>Awit
<NAME><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 = 202013869
delete_user(202013869)
delete_all_users()
def add(addend1, addend2):
  print("I hate Math addend1 and addend2")
  return addend1 + addend2
  

def power_of_base2(exponent):
    return 2**exponent

addend1 = 6
addend2 = 21

exponent = 7

#add(addend1, addend2)
power_of_base2(exponent)
add(addend1, addend2)<jupyter_output>I hate Math addend1 and addend2<jupyter_text>Activity Calculator<jupyter_code>name = input("<NAME>: ")
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))
name = input("Enter your name: ")
cn = input("Enter your course name: ")
pg = input("Enter prelim grade: ")
mg = input("Enter midterm grade: ")
fg = input("Enter finals grade: ")

pg = int(pg)
mg = int(mg)
fg = int(fg)

sem_grade = (pg*.3) + (mg*.3) + (fg*.4)


if (sem_grade > 89):
  print("Hello {}, your semestral grade in {} is: {} 😭".format(name, cn, sem_grade))
elif(sem_grade == 85):
  print("Hello {}, your semestral grade in {} is: {} 😀".format(name, cn, sem_grade))
else:
  print("Hello {}, your semestral grade in {} is: {} 🥰".format(name, cn, sem_grade))<jupyter_output>Enter your name: <NAME>
Enter your course name: CHE
Enter prelim grade: 89
Enter midterm grade: 85
Enter finals grade: 87
Hello <NAME>, your semestral grade in CHE is: 87.0 🥰
StarcoderdataJupyterStructuredCleanDedup