<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 = 1
a,b = 0, -1
b
type(x)
int
y = 1.0
type(y)
x = float(x)
type (x)
s,t,u = "0", '1', 'one'
type(t)
s_int = int(s)
s_int<jupyter_output><empty_output><jupyter_text>Operations  Arithmetic<jupyter_code>l,o,v,e = 2.0, -0.5, 0, -32
# Addition
s = l+o
s
### Subtraction
D = o-e
D
### Multiplication
P = l*e
P
### Division
Q = v/l
Q
### Floor Division
Fq = l//o
Fq
### Exponentiation
E = l**o
E
### Modulo
mod = e%l
mod<jupyter_output><empty_output><jupyter_text>Assignment Operations<jupyter_code>G, H, J, K = 0, 100, 2, 2
G += l
G
H -= e
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<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
disconj = p or q
disconj
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 count is:", cnt)
cnt +=1
print(f"{string}, Current count is: {cnt}")
sem_grade = 100
name = "Devinz"
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("Name: ")
pg = input("Enter prelim grade: ")
mg = input("Enter midterm grade: ")
fg = input("Enter finals grade: ")
sem_grade = 95
print("Hello {}, your semestral grade is: {}" .format(name, sem_grade))
l, v = 0, 10
while(l<=v):
   print(f"{l}\t|\t{v}")
   l+=1
l=0
for l in range(20):
      print(l)
playlist = ["Lips of an Angel", "Favorite Girl", "Tonight"]
print('Now Playing:\n')
for song in playlist:
      print(song)<jupyter_output>Now Playing:

Lips of an Angel
Favorite Girl
Tonight<jupyter_text>Flow Control  Condition Statements<jupyter_code>beautiful, simple = 14, 12
if(beautiful == simple):
      print("Ok fine")
elif(beautiful>simple):
      print("That's me")
else:
      print("Try again")<jupyter_output>That's me<jupyter_text>Functions<jupyter_code>def delete_user (userid):
    print("Successfully deleted user: {}".format(userid))

def delete_all_users ():
    print("Successfully deleted all users")
userid = "Maine"
delete_user("Maine")
delete_all_users()
def add(addend1, addend2):
    print("I'm not dumb, it's")
    return addend1 + addend2

def power_of_base2(exponent):
    return 4**exponent

addend1 = 7
addend2 = 3

exponent = 6

add(addend1, addend2)
power_of_base2(exponent)<jupyter_output>I'm not dumb, its
{'fraction_non_alphanumeric': 0.1490818549642079, 'fraction_numerical': 0.02583255524431995, 'mean_word_length': 4.843636363636364, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 32, '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': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '306872', 'license': 'Apache-2.0', 'n_tokens_mistral': 1365, 'n_tokens_neox': 1300, 'n_words': 368, 'path': 'Activity_1_Python_Fundamentals.ipynb', 'repo_name': '2lory/Linear-Algebra_ChE_2nd-Sem-2021-2022', 'size': '3213'}