From 08de5d95f70fd6884a05e92d15c5e1321a789fc8 Mon Sep 17 00:00:00 2001 From: Ibrahim Ozel Date: Thu, 19 Nov 2026 01:34:26 +0300 Subject: [PATCH 1/7] =?UTF-8?q?Create=20info=5Fibrahim=5F=C3=B6zel.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "Week01/info_ibrahim_\303\266zel.py" | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 "Week01/info_ibrahim_\303\266zel.py" diff --git "a/Week01/info_ibrahim_\303\266zel.py" "b/Week01/info_ibrahim_\303\266zel.py" new file mode 100644 index 00000000..f45a339c --- /dev/null +++ "b/Week01/info_ibrahim_\303\266zel.py" @@ -0,0 +1,2 @@ +student_id = "220316056" +full_name = "İbrahim Özel" From 8e9eb5cdb6c317016320e114d3432d6742b39ba5 Mon Sep 17 00:00:00 2001 From: Ibrahim Ozel Date: Thu, 19 Nov 2026 01:36:21 +0300 Subject: [PATCH 2/7] =?UTF-8?q?Create=20types=5Fibrahim=5F=C3=B6zel.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "Week02/types_ibrahim_\303\266zel.py" | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 "Week02/types_ibrahim_\303\266zel.py" diff --git "a/Week02/types_ibrahim_\303\266zel.py" "b/Week02/types_ibrahim_\303\266zel.py" new file mode 100644 index 00000000..2c22742f --- /dev/null +++ "b/Week02/types_ibrahim_\303\266zel.py" @@ -0,0 +1,4 @@ +my_int = 32 +my_float = 3.32 +my_bool = True +my_complex = 3 + 2j From 60d12dff07f2e8e9a1129b6de92e1fb049eea461 Mon Sep 17 00:00:00 2001 From: Ibrahim Ozel Date: Thu, 19 Nov 2026 01:39:36 +0300 Subject: [PATCH 3/7] =?UTF-8?q?Create=20pyramid=5Fibrahim=5F=C3=B6zel.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "Week03/pyramid_ibrahim_\303\266zel.py" | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 "Week03/pyramid_ibrahim_\303\266zel.py" diff --git "a/Week03/pyramid_ibrahim_\303\266zel.py" "b/Week03/pyramid_ibrahim_\303\266zel.py" new file mode 100644 index 00000000..55fc064c --- /dev/null +++ "b/Week03/pyramid_ibrahim_\303\266zel.py" @@ -0,0 +1,9 @@ +def calculate_pyramid_height(number_of_blocks): + height = 0 + blocks = 0 + + while blocks + height + 1 <= number_of_blocks: + height += 1 + blocks += height + + return height From 835122ae66ffd9d27444c6aec26125f204e3c255 Mon Sep 17 00:00:00 2001 From: Ibrahim Ozel Date: Thu, 19 Nov 2026 01:40:39 +0300 Subject: [PATCH 4/7] =?UTF-8?q?Create=20sequences=5Fibrahim=5F=C3=B6zel.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "Week03/sequences_ibrahim_\303\266zel.py" | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 "Week03/sequences_ibrahim_\303\266zel.py" diff --git "a/Week03/sequences_ibrahim_\303\266zel.py" "b/Week03/sequences_ibrahim_\303\266zel.py" new file mode 100644 index 00000000..ef181f2c --- /dev/null +++ "b/Week03/sequences_ibrahim_\303\266zel.py" @@ -0,0 +1,20 @@ +def remove_duplicates(seq: list) -> list: + + result = [] + for item in seq: + if item not in result: + result.append(item) + return result + + +def list_counts(seq: list) -> dict: + + counts = {} + for item in seq: + counts[item] = counts.get(item, 0) + 1 + return counts + + +def reverse_dict(d: dict) -> dict: + + return {value: key for key, value in d.items()} From 092e3fd756465508cd45c1d09dd8dc91a759a53a Mon Sep 17 00:00:00 2001 From: Ibrahim Ozel Date: Thu, 19 Nov 2026 01:43:41 +0300 Subject: [PATCH 5/7] =?UTF-8?q?Create=20decorators=5Fibrahim=5F=C3=B6zel.p?= =?UTF-8?q?y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "Week04/decorators_ibrahim_\303\266zel.py" | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 "Week04/decorators_ibrahim_\303\266zel.py" diff --git "a/Week04/decorators_ibrahim_\303\266zel.py" "b/Week04/decorators_ibrahim_\303\266zel.py" new file mode 100644 index 00000000..e6cee147 --- /dev/null +++ "b/Week04/decorators_ibrahim_\303\266zel.py" @@ -0,0 +1,31 @@ +import time +import tracemalloc + +def performance(func): + + def wrapper(*args, **kwargs): + + tracemalloc.start() + start = time.perf_counter() + start_mem = tracemalloc.get_traced_memory()[0] + tracemalloc.reset_peak() + + try: + result = func(*args, **kwargs) + + finally: + end = time.perf_counter() + current, peak = tracemalloc.get_traced_memory() + + performance.counter += 1 + performance.total_time += end - start + performance.total_mem += peak - start_mem + + tracemalloc.stop() + + return result + return wrapper + +performance.counter = 0 +performance.total_time = 0 +performance.total_mem = 0 From 92b5d60b342cded8d8b24ed6693eed8075d8da0d Mon Sep 17 00:00:00 2001 From: Ibrahim Ozel Date: Thu, 19 Nov 2026 01:45:20 +0300 Subject: [PATCH 6/7] =?UTF-8?q?Create=20functions=5Fibrahim=5F=C3=B6zel.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "Week04/functions_ibrahim_\303\266zel.py" | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 "Week04/functions_ibrahim_\303\266zel.py" diff --git "a/Week04/functions_ibrahim_\303\266zel.py" "b/Week04/functions_ibrahim_\303\266zel.py" new file mode 100644 index 00000000..16bf3bc1 --- /dev/null +++ "b/Week04/functions_ibrahim_\303\266zel.py" @@ -0,0 +1,27 @@ +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 does arithmetic opearations. + + :param1: first number to be exponantiated + :param2: second number to be exponantiated + :param3: power of the first number + :param4: power of the second number + :param5: divisor of sum of exponantiated numbers + + :return: division the sum of exponantiated numbers + """ + return (x**a + y**b) / c + +call_counter = 0 +caller_dict = {} +def fn_w_counter() -> (int, dict[str, int]): + caller = __name__ + global call_counter + call_counter += 1 + if caller in caller_dict: + caller_dict[caller] += 1 + else: + caller_dict[caller] = 1 + return call_counter, caller_dict From 7fa7a5be4f78004a9bbf40beefb5b3027ab3026d Mon Sep 17 00:00:00 2001 From: Ibrahim Ozel Date: Thu, 19 Nov 2026 01:46:21 +0300 Subject: [PATCH 7/7] =?UTF-8?q?Create=20emails=5Fibrahim=5F=C3=B6zel.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "Week05/emails_ibrahim_\303\266zel.py" | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 "Week05/emails_ibrahim_\303\266zel.py" diff --git "a/Week05/emails_ibrahim_\303\266zel.py" "b/Week05/emails_ibrahim_\303\266zel.py" new file mode 100644 index 00000000..37bbcc49 --- /dev/null +++ "b/Week05/emails_ibrahim_\303\266zel.py" @@ -0,0 +1,30 @@ +class Emails(list): + def __init__(self, email_list): + checked = self.validate(email_list) + super().__init__(checked) + self.data = checked + + def validate(self, email_list): + result = [] + for item in email_list: + if type(item) is not str: + raise ValueError("Only strings are allowed") + if item.count("@") != 1: + raise ValueError("Invalid email: " + item) + user, domain = item.split("@") + if user == "" or "." not in domain: + raise ValueError("Invalid email: " + item) + if domain.startswith(".") or domain.endswith("."): + raise ValueError("Invalid email: " + item) + if item not in result: + result.append(item) + return result + + def __repr__(self): + return "Emails(" + str(list(self)) + ")" + + def __str__(self): + text = "Emails:\n" + for i, mail in enumerate(self, start=1): + text += f"{i}. {mail}\n" + return text