Skip to content

All my work #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions aboutMe.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# This file is SUPER IMPORTANT. It's what joins your github name to your
# student number, and that's what makes sure that you get a mark.

first_name: Ben
studentNumber: z1234567 # if you're not at UNSW, your org name, e.g. BVN
first_name: Brian
studentNumber: z5491986 # if you're not at UNSW, your org name, e.g. BVN
# accounts
stackOverflowLink: https://stackoverflow.com/users/1835727/ben
github: notionparallax
stackOverflowLink: https://stackoverflow.com/users/25304061/brian-thai
github: BrianThai12
# This format is called YAML which stands for Yet Another Markup Language
# It's supposed to be machine readable, and human readable. It does a pretty
# good job of both of those goals, but there are some gotchas:
Expand Down
20 changes: 20 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
GitPython
black
colorama
func_timeout
ipykernel
matplotlib
mypy
numpy
openpyxl
pandas
pillow
pip-tools
pipwin
pytest
requests
ruamel.yaml
wheel
seaborn
pyogrio
geopandas
34 changes: 34 additions & 0 deletions set1/checkID.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"architecture": [
"64bit",
"WindowsPE"
],
"machine": "AMD64",
"os_name": "nt",
"platform": "Windows-10-10.0.19045-SP0",
"processor": "Intel64 Family 6 Model 158 Stepping 10, GenuineIntel",
"release": "10",
"system": "Windows",
"uname": [
"Windows",
"DESKTOP-6F80KR6",
"10",
"10.0.19045",
"AMD64",
"Intel64 Family 6 Model 158 Stepping 10, GenuineIntel"
],
"version": "10.0.19045",
"python_build": [
"main",
"Jun 18 2024 15:03:56"
],
"python_compiler": "MSC v.1929 64 bit (AMD64)",
"python_implementation(": "CPython",
"python_version(": "3.12.4",
"python_version_tuple": [
"3",
"12",
"4"
],
"cpu_count": 6
}
2 changes: 2 additions & 0 deletions set1/readme.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
TODO: Reflect on what you learned this week and what is still unclear.

How to write and print out words, specifically "Hello world!"
7 changes: 7 additions & 0 deletions set1/requestsWorking.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝
🍝 🍝
🍝 Python and requests are working! 🍝
🍝 🍝
🍝 All hail his noodly appendage! 🍝
🍝 🍝
🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝🍝
2 changes: 1 addition & 1 deletion set10/readme.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
TODO: Reflect on what you learned this week and what is still unclear.
TODO: I learnt how to more effectively utilise functions and how powerful they can be to clean up your work
10 changes: 5 additions & 5 deletions set2/exercise0.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def add_5(a_number):
except expressed in python, not english
"""
# If you need to do any working steps, do them in here
the_answer = None # 👈 whenever you see the_answer = None, you need to change that to your actual answer
the_answer = a_number + 5 # 👈 whenever you see the_answer = None, you need to change that to your actual answer
return the_answer


Expand All @@ -53,7 +53,7 @@ def adder(a_number, another_number):

Same as above, but with any two numbers.
"""
the_answer = None
the_answer = a_number + another_number
return the_answer


Expand All @@ -68,7 +68,7 @@ def shout(a_string):
they all do different things. You'll need to actually read the
docs to find out which one you actually need.
"""
the_answer = None
the_answer = a_string.upper()
return the_answer


Expand All @@ -81,7 +81,7 @@ def really_shout(a_string):
that you've reused the function you already wrote.
Look up how to 'concatinate' strings to make this happen.
"""
the_answer = None
the_answer = shout(a_string) + '!'
return the_answer


Expand All @@ -97,7 +97,7 @@ def shout_with_a_number(a_string, a_number):
challenge, see if you can make the test pass with at least two ways
of doing the same job.
"""
the_answer = None
the_answer = f"{a_string.upper()} {a_number}"
return the_answer


Expand Down
16 changes: 8 additions & 8 deletions set2/exercise2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@
import string

# E.g. det isn't a reserved word, it should be def
det getLetter(index):
def getLetter(index):
the_alphabet = string.ascii_lowercase + " "
return the_alphabet(index] # <-- this should be using [] to index into a list
return the_alphabet[index] # <-- this should be using [] to index into a list


def set2exersise2(); # this is semi-right
indices = [12: 2, 26, 7, 0, 12, 12, 4, 17] # the error messages aren't always helpful 😿
def set2exersise2(): # this is semi-right
indices = [12, 2, 26, 7, 0, 12, 12, 4, 17] # the error messages aren't always helpful 😿
wordArray = [getLetter(x) for x in indices]
wordArray[0] = wordArray[0].upper()
wordArray{1} = wordArray[1].upper() # <-- assigning to an array, another bracket problem
wordArray[3} = wordArray[3].upper{}
wordArray[1] = wordArray[1].upper() # <-- assigning to an array, another bracket problem
wordArray[3] = wordArray[3].upper()
secret_word="".join(wordArray)
print(secret_word)
return secret_word


if __name__ = = "__main__":
if __name__ == "__main__":
# ⟰-- we use = for asignment,
# and == for checking if things are equal,
# this isn't either!
hero = set2exersise2()
prin(hero)
print(hero)
# Say what this prints in your readme file for this week, along with any
# comments about what you learnt by doing this exercise
82 changes: 67 additions & 15 deletions set2/exercise3.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ def is_odd(a_number):
Look into modulo division using the '%' operator as one way of doing this.

e.g. 4 % 2 = 0
13 %12 = 1
13 % 12 = 1
3 % 2 = 1

So if a_number modulo two is zero, then it's even.
"""
return None

return a_number %2 != 0

def fix_it(moves=True, should_move=True):
"""Decide what to do.
Expand All @@ -36,12 +35,18 @@ def fix_it(moves=True, should_move=True):
Most people write this function with 4 return statements.
As an extra challenge, see if you can get that down to three.
"""
return None

if moves and should_move:
return "No Problem"
elif moves and not should_move:
return "Duct Tape"
elif not moves and not should_move:
return "No Problem"
elif not moves and should_move:
return "WD-40"


def loops_preview():
"""Make 8 poops.

Using a for loop
return a list of 8 items, each one a string with exacly one 💩 in it.
E.g.: ['💩', '💩', '💩', '💩', '💩', '💩', '💩', '💩']
Expand All @@ -59,7 +64,10 @@ def loops_1a():
return a list of 10 items, each one a string with exacly one star in it.
E.g.: ['*', '*', '*', '*', '*', '*', '*', '*', '*', '*']
"""
return None
star_list = []
for i in range(10):
star_list.append("*")
return star_list


def loops_1c(number_of_items=5, symbol="#"):
Expand All @@ -72,7 +80,10 @@ def loops_1c(number_of_items=5, symbol="#"):
Remember that you're being passed arguments here. Don't hard code the number
or the symbol, let it be whatever it wants to be.
"""
return None
hash_list = []
for i in range(number_of_items):
hash_list.append(symbol)
return hash_list


def loops_2_preview():
Expand Down Expand Up @@ -114,7 +125,14 @@ def loops_2():
['*', '*', '*', '*', '*', '*', '*', '*', '*', '*'],
]
"""
return None
field = []
for i in range(10):
row = []
for j in range(10):
row.append("*")
field.append(row)
return field



def loops_3():
Expand All @@ -138,7 +156,13 @@ def loops_3():
TIP: notice that this needs to to return strings of numbers,
so call str(number) to cast.
"""
return None
number_square = []
for i in range(10):
number_row =[]
for j in range(10):
number_row.append(str(i))
number_square.append(number_row)
return number_square


def loops_4():
Expand All @@ -158,7 +182,13 @@ def loops_4():
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
]
"""
return None
number_square = []
for i in range(10):
number_row =[]
for j in range(10):
number_row.append(str(j))
number_square.append(number_row)
return number_square


def loops_5():
Expand Down Expand Up @@ -188,7 +218,14 @@ def loops_5():
f"There are {num_bottles} green bottles"
you'll come to see the pros and cons of each over time.
"""
return None
number_square = []
for i in range(10):
coordinate_row =[]
for j in range(5):
coordinate_row.append("(i{}, j{})".format(i, j))
number_square.append(coordinate_row)
return(number_square)



def loops_6():
Expand All @@ -211,7 +248,13 @@ def loops_6():
You can use a variable.
TIP: look out for the starting condition.
"""
return None
wedge = []
for i in range(10):
row =[]
for j in range(i + 1):
row.append(str(j))
wedge.append(row)
return(wedge)


def loops_7():
Expand All @@ -235,8 +278,17 @@ def loops_7():
This is a hard problem. Use lots of experimentation and draw
lots of diagrams!
"""
return None

def loops_7():
pyramid = []
for i in range(5):
row = []
for j in range(9):
if j >= 4 - i and j <= 4 + i:
row.append('*')
else:
row.append(' ')
pyramid.append(row)
return pyramid

if __name__ == "__main__":
# this section does a quick test on your results and prints them nicely.
Expand Down
8 changes: 8 additions & 0 deletions set2/readme.md
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
TODO: Reflect on what you learned this week and what is still unclear.

In exercise 0 I learned about how to write with variables, strings and integers

In exercise 1 I learned how to debug and pause a line to test what it does

In exercise 2 I fixed up code that was broken. The secret word was: MC Hammer

In exercise 3 I leared how to use for loops, append things.
Loading