From dedc8684636bbe11b2c38e19c613be4f6a73a131 Mon Sep 17 00:00:00 2001 From: aygulozlem45-web Date: Sun, 5 Apr 2026 14:35:42 +0300 Subject: [PATCH 1/2] Create functions_aygul_ozkeklik.py --- Week04/functions_aygul_ozkeklik.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Week04/functions_aygul_ozkeklik.py diff --git a/Week04/functions_aygul_ozkeklik.py b/Week04/functions_aygul_ozkeklik.py new file mode 100644 index 00000000..3902582f --- /dev/null +++ b/Week04/functions_aygul_ozkeklik.py @@ -0,0 +1,8 @@ +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 : + return (x**a + y**b)/c + +def fn_w_counter() -> (int, dict[str, int]): + if not hasattr(fn_w_counter, "calls"): + fn_w_counter.calls = 0 From dee8a26d3ba3f22907f733cb0c9ae56c5a258656 Mon Sep 17 00:00:00 2001 From: aygulozlem45-web Date: Sun, 5 Apr 2026 14:57:14 +0300 Subject: [PATCH 2/2] Update functions_aygul_ozkeklik.py --- Week04/functions_aygul_ozkeklik.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Week04/functions_aygul_ozkeklik.py b/Week04/functions_aygul_ozkeklik.py index 3902582f..1aa53336 100644 --- a/Week04/functions_aygul_ozkeklik.py +++ b/Week04/functions_aygul_ozkeklik.py @@ -1,8 +1,10 @@ -custom_power = lambda x=0,/, e=1 : x ** e +custom_power = lambda x, e: x ** e -def custom_equation(x: int = 0 , y: int = 0 , /, a: int = 1, b: int=1 , * , c: int = 1) -> float : - return (x**a + y**b)/c +def custom_equation(x, y, a, b, c): + return (x**a + y**b) / c -def fn_w_counter() -> (int, dict[str, int]): - if not hasattr(fn_w_counter, "calls"): - fn_w_counter.calls = 0 +def fn_w_counter(): + if not hasattr(fn_w_counter, "count"): + fn_w_counter.count = 0 + fn_w_counter.count += 1 + return fn_w_counter.count, {__name__.split('.')[-1]: fn_w_counter.count}