<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 = 4
a, b = 0, -4
b
type(a)
y= 4.0
type(y)
x=float(x)
x
s,t,u ="0",'4', 'four'
type(s)
s_int = int(s)
s_int<jupyter_output><empty_output><jupyter_text>Operations Arithmethic<jupyter_code>t,a,k,i=1.0, 2.0, 3.0, 4.0
#Addition
S=t+a
S
###Subtraction
D= a-i
D
### Multiplication
P=t*i
P
### Division
Q= t/a
Q
### Floor Division
Fq = t//a
Fq
### Exponentiation
E = t**a
E
### Modulo
mod = i%t
mod<jupyter_output><empty_output><jupyter_text>Assignment Operations<jupyter_code>J, O, S, H = 5.0, 6.0, 7.0, 8.0
J += t
J
H -= i
H
S *= 7.0
S
H **8.0
H<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
t4<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<jupyter_output><empty_output><jupyter_text>I/O<jupyter_code>print("Play Valorant")
cnt=1
string = "Play Valorant"
print(string, ",Current run count is:", cnt)
cnt += 1
print(f"{string}, Current count is: {cnt}")
Valo_Stand = 1000
name= "Taki"
print("Play,",name, "your valorant standing is:{1000})" ,Valo_Stand) 
w_pg, w_mg, w_fg= 0.3, 0.3, 0.4
print("The Weights of your semestral grade 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("My name is:")
pg = input("Enter prelim grade:")
mg = input("Enter midterm grade")
fg = input("Enter finals grade:")
sem_grade = 80
print("Hello{}, your semestral grade is :{}". format(name,sem_grade))<jupyter_output>My name is: Taki
Enter prelim grade: 80
Enter midterm grade 80
Enter finals grade: 80
Hello Taki, your semestral grade is :80<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/t|/t10
1/t|/t10
2/t|/t10
3/t|/t10
4/t|/t10
5/t|/t10
6/t|/t10
7/t|/t10
8/t|/t10
9/t|/t10
10/t|/t10<jupyter_text>For<jupyter_code># for(int i =0; i<10; i++){#printf(i)#}
i=0
for i in range(11):
  print(i)
playlist = ["Happier", "Crazier", "Shake"]
print('Now playing:/n')
for song in playlist:
  print(song)<jupyter_output><empty_output><jupyter_text>Flow Control  Condition Statements<jupyter_code>numeral1, numeral2 = 12, 14
if(numeral1 == numeral2):
  print("yes")
elif(numeral1>numeral2):
    print("uhmm")
else:
    print("HIHI")<jupyter_output>HIHI<jupyter_text>Functions<jupyter_code># void Delete(int userid){
# delete(userid):
#}

def delete_user(userid):
  print("successfully deleted user:{}".format(userid))
def delete_all_users():
  print("successfully deleted all users")
userid= 202014282
delete_user(202014282)
delete_all_users()
def add(addend1,addend2):
  print("I know how to add addend1 and addend2")
  return addend1 + addend2

def power_of_base2(exponent):
  return 2**exponent

addend1 = 4
addend2 = 8

exponent= 5

add(addend1,addend2)
power_of_base2(exponent)
add(addend1, addend2)
print()
name = input('Your name is');
prelim = float(input('prelim grade'));
midterm = float(input('midterm grade'));
final = float(input('final grade'));
sem_grade = (prelim*0.30) + (midterm*0.30) + (final*0.40);

sem_grade = "{:.2f}". format(sem_grade)

print();
print("Good day!,", name, );
if float(sem_grade) > 70.00:
  print("your grade is", sem_grade, "\U0001F600");
elif float(sem_grade) == 70.00:
  print("your grade is", sem_grade, "\U0001F601");
elif float( sem_grade) < 70.00:
  print("you grade is", sem_grade,"\U0001F62D")
  print();<jupyter_output>Your name is <NAME>
prelim grade 88.9
midterm grade 88
final grade 88.5

Good day!,  <NAME>
your grade is 88.47 😀
{'fraction_non_alphanumeric': 0.16196673897324657, 'fraction_numerical': 0.0551940226560617, 'mean_word_length': 5.5664556962025316, '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': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '274208', 'license': 'Apache-2.0', 'n_tokens_mistral': 1892, 'n_tokens_neox': 1764, 'n_words': 439, 'path': 'Copy_of_Activity_1_Python_Fundamentals.ipynb', 'repo_name': 'Takiramen/Linear-Algebra_ChE_2nd-Sem-2021-2022', 'size': '4173'}