Skip to content
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
2 changes: 2 additions & 0 deletions Week01/info_alihan_esentas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
student_id = "220316034"
full_name = "Alihan_esentas"
4 changes: 4 additions & 0 deletions Week02/types_alihan_esentas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
my_int = 13
my_float = 21.3
my_bool = False
my_complex = 11j
7 changes: 7 additions & 0 deletions Week03/pyramid_alihan_esentas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def calculate_pyramid_height(blockNumber):
height = 0

while blockNumber > height:
height += 1
blockNumber -= height
return height
20 changes: 20 additions & 0 deletions Week04/decorators_alihan_esentas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import tracemalloc
import time

def performance(func):
performance.counter = 0
performance.total_time = 0.0
performance.total_mem = 0.0

def wrapper(*args, **kwargs):
tracemalloc.start()
start_time = time.time()
result = func(*args, **kwargs)
end_time = time.time()
current, peak = tracemalloc.get_traced_memory()
tracemalloc.stop()
performance.counter += 1
performance.total_time += (end_time - start_time)
performance.total_mem += peak
return result
return wrapper
17 changes: 17 additions & 0 deletions Week05/awaitme_alihan_esentas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import asyncio

def awaitme(fn):
if asyncio.iscoroutinefunction(fn):
return fn

async def wrapper(*args, **kwargs):
return fn(*args, **kwargs)

try:
wrapper.__name__ = fn.__name__
wrapper.__doc__ = fn.__doc__
wrapper.__annotations__ = fn.__annotations__
except (AttributeError, TypeError):
pass

return wrapper