Update paths and actually add files
This commit is contained in:
176
.gitignore
vendored
Normal file
176
.gitignore
vendored
Normal file
@@ -0,0 +1,176 @@
|
|||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
|
||||||
|
# C extensions
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Distribution / packaging
|
||||||
|
.Python
|
||||||
|
build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
wheels/
|
||||||
|
share/python-wheels/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
MANIFEST
|
||||||
|
|
||||||
|
# PyInstaller
|
||||||
|
# Usually these files are written by a python script from a template
|
||||||
|
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||||
|
*.manifest
|
||||||
|
*.spec
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
pip-delete-this-directory.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
htmlcov/
|
||||||
|
.tox/
|
||||||
|
.nox/
|
||||||
|
.coverage
|
||||||
|
.coverage.*
|
||||||
|
.cache
|
||||||
|
nosetests.xml
|
||||||
|
coverage.xml
|
||||||
|
*.cover
|
||||||
|
*.py,cover
|
||||||
|
.hypothesis/
|
||||||
|
.pytest_cache/
|
||||||
|
cover/
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
*.mo
|
||||||
|
*.pot
|
||||||
|
|
||||||
|
# Django stuff:
|
||||||
|
*.log
|
||||||
|
local_settings.py
|
||||||
|
db.sqlite3
|
||||||
|
db.sqlite3-journal
|
||||||
|
|
||||||
|
# Flask stuff:
|
||||||
|
instance/
|
||||||
|
.webassets-cache
|
||||||
|
|
||||||
|
# Scrapy stuff:
|
||||||
|
.scrapy
|
||||||
|
|
||||||
|
# Sphinx documentation
|
||||||
|
docs/_build/
|
||||||
|
|
||||||
|
# PyBuilder
|
||||||
|
.pybuilder/
|
||||||
|
target/
|
||||||
|
|
||||||
|
# Jupyter Notebook
|
||||||
|
.ipynb_checkpoints
|
||||||
|
|
||||||
|
# IPython
|
||||||
|
profile_default/
|
||||||
|
ipython_config.py
|
||||||
|
|
||||||
|
# pyenv
|
||||||
|
# For a library or package, you might want to ignore these files since the code is
|
||||||
|
# intended to run in multiple environments; otherwise, check them in:
|
||||||
|
# .python-version
|
||||||
|
|
||||||
|
# pipenv
|
||||||
|
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
||||||
|
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
||||||
|
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
||||||
|
# install all needed dependencies.
|
||||||
|
#Pipfile.lock
|
||||||
|
|
||||||
|
# UV
|
||||||
|
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
||||||
|
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
||||||
|
# commonly ignored for libraries.
|
||||||
|
#uv.lock
|
||||||
|
|
||||||
|
# poetry
|
||||||
|
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
||||||
|
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
||||||
|
# commonly ignored for libraries.
|
||||||
|
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
||||||
|
#poetry.lock
|
||||||
|
|
||||||
|
# pdm
|
||||||
|
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
||||||
|
#pdm.lock
|
||||||
|
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
||||||
|
# in version control.
|
||||||
|
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
||||||
|
.pdm.toml
|
||||||
|
.pdm-python
|
||||||
|
.pdm-build/
|
||||||
|
|
||||||
|
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
||||||
|
__pypackages__/
|
||||||
|
|
||||||
|
# Celery stuff
|
||||||
|
celerybeat-schedule
|
||||||
|
celerybeat.pid
|
||||||
|
|
||||||
|
# SageMath parsed files
|
||||||
|
*.sage.py
|
||||||
|
|
||||||
|
# Environments
|
||||||
|
.env
|
||||||
|
.venv
|
||||||
|
env/
|
||||||
|
venv/
|
||||||
|
ENV/
|
||||||
|
env.bak/
|
||||||
|
venv.bak/
|
||||||
|
|
||||||
|
# Spyder project settings
|
||||||
|
.spyderproject
|
||||||
|
.spyproject
|
||||||
|
|
||||||
|
# Rope project settings
|
||||||
|
.ropeproject
|
||||||
|
|
||||||
|
# mkdocs documentation
|
||||||
|
/site
|
||||||
|
|
||||||
|
# mypy
|
||||||
|
.mypy_cache/
|
||||||
|
.dmypy.json
|
||||||
|
dmypy.json
|
||||||
|
|
||||||
|
# Pyre type checker
|
||||||
|
.pyre/
|
||||||
|
|
||||||
|
# pytype static type analyzer
|
||||||
|
.pytype/
|
||||||
|
|
||||||
|
# Cython debug symbols
|
||||||
|
cython_debug/
|
||||||
|
|
||||||
|
# PyCharm
|
||||||
|
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
||||||
|
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
||||||
|
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||||
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
|
#.idea/
|
||||||
|
|
||||||
|
# Ruff stuff:
|
||||||
|
.ruff_cache/
|
||||||
|
|
||||||
|
# PyPI configuration file
|
||||||
|
.pypirc
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
25
shared/notes-and-examples/2026.01.21/main.py
Normal file
25
shared/notes-and-examples/2026.01.21/main.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
def bubble_sort_example():
|
||||||
|
numbers = [5, 24, 18, 95, 45, 502, 1]
|
||||||
|
|
||||||
|
for i in range(len(numbers)):
|
||||||
|
for j in range(i, len(numbers)):
|
||||||
|
if numbers[i] > numbers[j]:
|
||||||
|
numbers[j], numbers[i] = numbers[i], numbers[j]
|
||||||
|
|
||||||
|
|
||||||
|
print(numbers)
|
||||||
|
|
||||||
|
def insertion_sort_example():
|
||||||
|
numbers = [5, 24, 18, 95, 502, 45, 1]
|
||||||
|
|
||||||
|
for i in range(1, len(numbers)):
|
||||||
|
for j in range(i - 1, -1, -1):
|
||||||
|
if numbers[j] > numbers[j + 1]:
|
||||||
|
numbers[j + 1], numbers[j] = numbers[j], numbers[j + 1]
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
|
print(numbers)
|
||||||
|
|
||||||
|
# bubble_sort_example();
|
||||||
|
insertion_sort_example();
|
||||||
35
shared/notes-and-examples/2026.01.28/full_linked_list.py
Normal file
35
shared/notes-and-examples/2026.01.28/full_linked_list.py
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
class Node:
|
||||||
|
next_node = None
|
||||||
|
|
||||||
|
def __init__(self, value):
|
||||||
|
self.value = value
|
||||||
|
|
||||||
|
# Homework:
|
||||||
|
# Make a linked list class with the functions:
|
||||||
|
# - append(node): add a node to the end of the list
|
||||||
|
# - insert(node, index): add a node to the middle of the list
|
||||||
|
# - remove(index): remove the first matching node from the list
|
||||||
|
|
||||||
|
class LinkedList:
|
||||||
|
head = None
|
||||||
|
tail = None
|
||||||
|
|
||||||
|
def append(Llist, thing):
|
||||||
|
if Llist.head==None:
|
||||||
|
Llist.head=Node(value=thing)
|
||||||
|
Llist.tail=Llist.head
|
||||||
|
return
|
||||||
|
Llist.tail.nextNode=Node(value=thing)
|
||||||
|
Llist.tail=Llist.tail.nextNode
|
||||||
|
|
||||||
|
|
||||||
|
list1=LinkedList()
|
||||||
|
append(list1, 'hi')
|
||||||
|
append(list1, 'hi again')
|
||||||
|
append(list1, 'why am I saying hi so many times?')
|
||||||
|
print(list1.head.value)
|
||||||
|
print(list1.head.nextNode.value)
|
||||||
|
print(list1.head.nextNode.nextNode.value)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
51
shared/notes-and-examples/2026.01.28/main.py
Normal file
51
shared/notes-and-examples/2026.01.28/main.py
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
some_numbers = [2, 5, 20, 18, 4]
|
||||||
|
|
||||||
|
more_numbers = some_numbers.copy()
|
||||||
|
|
||||||
|
some_numbers[2] = 100
|
||||||
|
|
||||||
|
# print(more_numbers[2]) # prints 100?
|
||||||
|
|
||||||
|
class Sample:
|
||||||
|
other_samples = []
|
||||||
|
value = 0
|
||||||
|
|
||||||
|
samples = [Sample(), Sample(), Sample()]
|
||||||
|
more_samples = samples.copy() # shallow copy
|
||||||
|
samples[1].value = 10
|
||||||
|
samples[1].other_samples.append(samples[0])
|
||||||
|
# print(more_samples[1].value) # 10
|
||||||
|
|
||||||
|
samples.append(Sample())
|
||||||
|
samples[3].value = 100
|
||||||
|
# print(more_samples[3].value)
|
||||||
|
|
||||||
|
other_sample.value = 40
|
||||||
|
# print(sample.value)
|
||||||
|
|
||||||
|
class Dog:
|
||||||
|
def __init__(self, age, name):
|
||||||
|
self.age = age
|
||||||
|
self.name = name
|
||||||
|
|
||||||
|
# dog_1 = Dog()
|
||||||
|
|
||||||
|
class Node:
|
||||||
|
next_node = None
|
||||||
|
|
||||||
|
def __init__(self, value):
|
||||||
|
self.value = value
|
||||||
|
|
||||||
|
node_1 = Node(0)
|
||||||
|
node_2 = Node(0)
|
||||||
|
|
||||||
|
node_2.value = 10
|
||||||
|
|
||||||
|
node_1.next_node = node_2
|
||||||
|
|
||||||
|
node_2.value = 20
|
||||||
|
|
||||||
|
current_node = node_1
|
||||||
|
while (current_node != None):
|
||||||
|
print(current_node.value)
|
||||||
|
current_node = current_node.next_node
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
class Sample:
|
||||||
|
other_samples = []
|
||||||
|
value = 0
|
||||||
|
|
||||||
|
sample = Sample()
|
||||||
|
other_sample = sample
|
||||||
|
sample.value = 20
|
||||||
|
print(other_sample.value)
|
||||||
13
shared/notes-and-examples/2026.02.04/main.py
Normal file
13
shared/notes-and-examples/2026.02.04/main.py
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
class Node:
|
||||||
|
next = None
|
||||||
|
previous = None
|
||||||
|
|
||||||
|
class Queue:
|
||||||
|
front = None
|
||||||
|
tail = None
|
||||||
|
|
||||||
|
def enqueue(self, node: Node):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def dequeue(self):
|
||||||
|
pass
|
||||||
Reference in New Issue
Block a user