From a6704b89860326f890964aa0c95e24246a10b080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fevzi=20Ba=C4=9Fr=C4=B1a=C3=A7=C4=B1k?= <124450541+fevzibagriacik@users.noreply.github.com> Date: Mon, 8 Dec 2025 23:29:09 +0300 Subject: [PATCH 1/4] Create functions_fevzi_bagriacik.py --- Week04/functions_fevzi_bagriacik.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Week04/functions_fevzi_bagriacik.py diff --git a/Week04/functions_fevzi_bagriacik.py b/Week04/functions_fevzi_bagriacik.py new file mode 100644 index 00000000..14d7fd60 --- /dev/null +++ b/Week04/functions_fevzi_bagriacik.py @@ -0,0 +1,18 @@ +custom_power = lambda x = 0, /, e = 1 : x ** e + +def custom_equation(x = 0, y = 0, /, a = 1, b = 1, *, c = 1): + """ + This function calculates (x ** a + y ** b) / c. + + :param x: First number (positional only, default 0) + :param y: Second number (positional only, default 0) + :param a: Third number (positional or keyword, default 1) + :param b: Fourth number (positional or keyword, default 1) + :param c: Fifth number (keyword only, default 1) + :return: (x ** a + y ** b) / c + """ + + return (x ** a + y ** b) / c + + + From 3150a5b025a797ec834cddba0e35ff0d08f61938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fevzi=20Ba=C4=9Fr=C4=B1a=C3=A7=C4=B1k?= <124450541+fevzibagriacik@users.noreply.github.com> Date: Mon, 8 Dec 2025 23:44:50 +0300 Subject: [PATCH 2/4] Update functions_fevzi_bagriacik.py --- Week04/functions_fevzi_bagriacik.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Week04/functions_fevzi_bagriacik.py b/Week04/functions_fevzi_bagriacik.py index 14d7fd60..8eb43efe 100644 --- a/Week04/functions_fevzi_bagriacik.py +++ b/Week04/functions_fevzi_bagriacik.py @@ -1,3 +1,5 @@ +import inspect + custom_power = lambda x = 0, /, e = 1 : x ** e def custom_equation(x = 0, y = 0, /, a = 1, b = 1, *, c = 1): @@ -14,5 +16,21 @@ def custom_equation(x = 0, y = 0, /, a = 1, b = 1, *, c = 1): return (x ** a + y ** b) / c +def fn_w_counter() -> (int, dict): + if not hasattr(fn_w_counter, 'total_count'): + fn_w_counter.total_count = 0 + fn_w_counter.caller_dict = {} + + caller_frame = inspect.currentframe().f_back + caller_name = caller_frame.f_globals['__name__'] + + fn_w_counter.total_count += 1 + + if caller_name in fn_w_counter.caller_dict: + fn_w_counter.caller_dict[caller_name] += 1 + else: + fn_w_counter.caller_dict[caller_name] = 1 + + return fn_w_counter.total_count, fn_w_counter.caller_dict From 5b29aba335c1942bc4c0e60009473adda8d3a97b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fevzi=20Ba=C4=9Fr=C4=B1a=C3=A7=C4=B1k?= <124450541+fevzibagriacik@users.noreply.github.com> Date: Mon, 8 Dec 2025 23:47:13 +0300 Subject: [PATCH 3/4] Update functions_fevzi_bagriacik.py --- Week04/functions_fevzi_bagriacik.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Week04/functions_fevzi_bagriacik.py b/Week04/functions_fevzi_bagriacik.py index 8eb43efe..afdf1b90 100644 --- a/Week04/functions_fevzi_bagriacik.py +++ b/Week04/functions_fevzi_bagriacik.py @@ -2,7 +2,7 @@ custom_power = lambda x = 0, /, e = 1 : x ** e -def custom_equation(x = 0, y = 0, /, a = 1, b = 1, *, c = 1): +def custom_equation(x=0, y=0, /, a=1, b=1, *, c=1) -> float: """ This function calculates (x ** a + y ** b) / c. From 2c585585701a7037d4905277fd05e98591447355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fevzi=20Ba=C4=9Fr=C4=B1a=C3=A7=C4=B1k?= <124450541+fevzibagriacik@users.noreply.github.com> Date: Mon, 8 Dec 2025 23:52:03 +0300 Subject: [PATCH 4/4] Update functions_fevzi_bagriacik.py --- Week04/functions_fevzi_bagriacik.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Week04/functions_fevzi_bagriacik.py b/Week04/functions_fevzi_bagriacik.py index afdf1b90..257263f7 100644 --- a/Week04/functions_fevzi_bagriacik.py +++ b/Week04/functions_fevzi_bagriacik.py @@ -2,9 +2,8 @@ custom_power = lambda x = 0, /, e = 1 : x ** e -def custom_equation(x=0, y=0, /, a=1, b=1, *, c=1) -> float: - """ - This function calculates (x ** a + y ** b) / c. +def custom_equation(x: int = 0, y: int = 0, /, a: int = 1, b: int = 1, *, c: int = 1) -> float: + """This function calculates (x ** a + y ** b) / c. :param x: First number (positional only, default 0) :param y: Second number (positional only, default 0) @@ -13,10 +12,9 @@ def custom_equation(x=0, y=0, /, a=1, b=1, *, c=1) -> float: :param c: Fifth number (keyword only, default 1) :return: (x ** a + y ** b) / c """ + return float((x + y + a + b) / c) - return (x ** a + y ** b) / c - -def fn_w_counter() -> (int, dict): +def fn_w_counter() -> (int, dict[str, int]): if not hasattr(fn_w_counter, 'total_count'): fn_w_counter.total_count = 0 fn_w_counter.caller_dict = {}