From f7a572b3b495895dccec5334ae75d7447f777ca2 Mon Sep 17 00:00:00 2001 From: MuhammedSalihYesilay Date: Tue, 31 Mar 2026 21:41:09 +0300 Subject: [PATCH 1/9] =?UTF-8?q?Add=20student=20information=20for=20Muhamme?= =?UTF-8?q?d=20Salih=20Ye=C5=9Filay?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Week01/Week01/info_muhammed_salih_yesilay.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Week01/Week01/info_muhammed_salih_yesilay.py diff --git a/Week01/Week01/info_muhammed_salih_yesilay.py b/Week01/Week01/info_muhammed_salih_yesilay.py new file mode 100644 index 00000000..ce1fcd6b --- /dev/null +++ b/Week01/Week01/info_muhammed_salih_yesilay.py @@ -0,0 +1,2 @@ +student_id = "220316059" +full_name = "Muhammed Salih Yeşilay" From c9bafe568f4ea511d713223c4d3be44450ab4336 Mon Sep 17 00:00:00 2001 From: MuhammedSalihYesilay Date: Tue, 31 Mar 2026 21:44:36 +0300 Subject: [PATCH 2/9] Add variables of different types in types_muhammedsalih_yesilay.py --- Week02/types_muhammedsalih_yesilay.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Week02/types_muhammedsalih_yesilay.py diff --git a/Week02/types_muhammedsalih_yesilay.py b/Week02/types_muhammedsalih_yesilay.py new file mode 100644 index 00000000..e4d7a077 --- /dev/null +++ b/Week02/types_muhammedsalih_yesilay.py @@ -0,0 +1,4 @@ +my_int = 24 +my_float = 1907.0 +my_bool = 10 == 10 +my_complex = 1807j From d3f25841a563d327d8a0ddf835b1b07961335ca4 Mon Sep 17 00:00:00 2001 From: MuhammedSalihYesilay Date: Tue, 31 Mar 2026 21:45:31 +0300 Subject: [PATCH 3/9] Delete Week01/Week01/info_muhammed_salih_yesilay.py --- Week01/Week01/info_muhammed_salih_yesilay.py | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 Week01/Week01/info_muhammed_salih_yesilay.py diff --git a/Week01/Week01/info_muhammed_salih_yesilay.py b/Week01/Week01/info_muhammed_salih_yesilay.py deleted file mode 100644 index ce1fcd6b..00000000 --- a/Week01/Week01/info_muhammed_salih_yesilay.py +++ /dev/null @@ -1,2 +0,0 @@ -student_id = "220316059" -full_name = "Muhammed Salih Yeşilay" From f84eef917650403d555d7daffebaf45cf4166d27 Mon Sep 17 00:00:00 2001 From: MuhammedSalihYesilay Date: Tue, 31 Mar 2026 21:47:09 +0300 Subject: [PATCH 4/9] =?UTF-8?q?Add=20student=20information=20for=20Muhamme?= =?UTF-8?q?d=20Salih=20Ye=C5=9Filay?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Week01/info_muhammedsalih_yesilay.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Week01/info_muhammedsalih_yesilay.py diff --git a/Week01/info_muhammedsalih_yesilay.py b/Week01/info_muhammedsalih_yesilay.py new file mode 100644 index 00000000..ce1fcd6b --- /dev/null +++ b/Week01/info_muhammedsalih_yesilay.py @@ -0,0 +1,2 @@ +student_id = "220316059" +full_name = "Muhammed Salih Yeşilay" From ae10cfa6ab3cd10d3e7ae96c889330ca01a5d96c Mon Sep 17 00:00:00 2001 From: MuhammedSalihYesilay Date: Tue, 31 Mar 2026 21:50:34 +0300 Subject: [PATCH 5/9] Add function to calculate pyramid height from blocks --- Week03/pyramid_muhammedsalih_yesilay.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Week03/pyramid_muhammedsalih_yesilay.py diff --git a/Week03/pyramid_muhammedsalih_yesilay.py b/Week03/pyramid_muhammedsalih_yesilay.py new file mode 100644 index 00000000..53cd2702 --- /dev/null +++ b/Week03/pyramid_muhammedsalih_yesilay.py @@ -0,0 +1,7 @@ +def calculate_pyramid_height(number_of_blocks): + height = 0 + + while number_of_blocks > height: + height += 1 + number_of_blocks -= height + return height From 2d469841c4a75c9473bb70f92879848cd25470ae Mon Sep 17 00:00:00 2001 From: MuhammedSalihYesilay Date: Tue, 31 Mar 2026 21:51:48 +0300 Subject: [PATCH 6/9] Add utility functions for list and dictionary operations --- Week03/sequences_muhammedsalih_yesilay.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Week03/sequences_muhammedsalih_yesilay.py diff --git a/Week03/sequences_muhammedsalih_yesilay.py b/Week03/sequences_muhammedsalih_yesilay.py new file mode 100644 index 00000000..c4c6fc33 --- /dev/null +++ b/Week03/sequences_muhammedsalih_yesilay.py @@ -0,0 +1,17 @@ +def remove_duplicates(seq : list) -> list: + return list(set(seq)) + +def list_counts(seq:list) -> dict: + L = {} + for i in seq: + if i in L: + L[i] += 1 + else: + L[i] = 1 + return L + +def reverse_dict(d : dict) -> dict: + rd = {} + for i, h in d.items(): + rd[h] = i + return rd From 12e31b130578b03bcdb228344e6e680d478f48f2 Mon Sep 17 00:00:00 2001 From: MuhammedSalihYesilay Date: Tue, 31 Mar 2026 21:56:16 +0300 Subject: [PATCH 7/9] Implement performance tracking decorator Added a performance decorator to track execution time and memory usage. --- Week04/decorators_muhammedsalih_yesilay.py | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Week04/decorators_muhammedsalih_yesilay.py diff --git a/Week04/decorators_muhammedsalih_yesilay.py b/Week04/decorators_muhammedsalih_yesilay.py new file mode 100644 index 00000000..f598313e --- /dev/null +++ b/Week04/decorators_muhammedsalih_yesilay.py @@ -0,0 +1,32 @@ +import tracemalloc, time + +def performance(func): + """ + Decorator to track function performance and record statistics. + + :param func: Function to decorate. + :type func: callable + :return: Wrapped function. + :rtype: callable + + :cvar counter: Number of calls. + :cvar total_time: Total execution time in seconds. + :cvar total_mem: Total peak memory in bytes. + """ + 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 From cc2ab0303e0d6f88b081373cd25f3d8552cc9430 Mon Sep 17 00:00:00 2001 From: MuhammedSalihYesilay Date: Tue, 31 Mar 2026 21:58:19 +0300 Subject: [PATCH 8/9] Implement custom power and equation functions Added custom_power lambda and custom_equation function for mathematical operations, along with a call counter function. --- Week04/functions_muhammedsalih_yesilay.py | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Week04/functions_muhammedsalih_yesilay.py diff --git a/Week04/functions_muhammedsalih_yesilay.py b/Week04/functions_muhammedsalih_yesilay.py new file mode 100644 index 00000000..37e9d111 --- /dev/null +++ b/Week04/functions_muhammedsalih_yesilay.py @@ -0,0 +1,29 @@ +custom_power = lambda x = 0, /, e = 1: x ** e + + +def custom_equation(x: int = 0, y: int = 0, /, a: int = 1, b: int = 1, *, c: int = 1) -> float: + """ + This function raises x to the power of a, y to the power of b, sums them, and then divides the result by c. + + :param x: The positional-only integer base parameter for the equation , default is 0 + :param y: The positional-only integer base parameter for the equation , default is 0 + :param a: The positional-or-keyword integer exponent parameter for the equation , default is 1 + :param b: The positional-or-keyword integer exponent parameter for the equation , default is 1 + :param c: The keyword-only integer divisor parameter for the equation , default is 1 + :return: The result of the calculation as a float and the equation is (x**a + y**b) / c + :rtype: float + """ + return (x**a + y**b) / c + + +def fn_w_counter() -> (int, dict[str, int]): + if not hasattr(fn_w_counter,'_call_counter'): + fn_w_counter._call_counter = 0 + fn_w_counter._caller_dict = {} + caller = __name__ + fn_w_counter._call_counter += 1 + if caller in fn_w_counter._caller_dict: + fn_w_counter._caller_dict[caller] += 1 + else: + fn_w_counter._caller_dict[caller] = 1 + return fn_w_counter._call_counter,fn_w_counter._caller_dict From ff36aff10753a1b093522ba9c51736334fab41e5 Mon Sep 17 00:00:00 2001 From: MuhammedSalihYesilay Date: Tue, 31 Mar 2026 22:00:11 +0300 Subject: [PATCH 9/9] Add awaitme decorator for async function handling Implement a decorator to await coroutine functions. --- Week05/awaitme_muhammedsalih_yesilay.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Week05/awaitme_muhammedsalih_yesilay.py diff --git a/Week05/awaitme_muhammedsalih_yesilay.py b/Week05/awaitme_muhammedsalih_yesilay.py new file mode 100644 index 00000000..7f7f7c53 --- /dev/null +++ b/Week05/awaitme_muhammedsalih_yesilay.py @@ -0,0 +1,9 @@ +import asyncio + +def awaitme(function): + async def wrapper(*args, **kwargs): + result = function(*args, **kwargs) + if asyncio.iscoroutine(result): + return await result + return result + return wrapper