From a751f84892cd312c7e1e2ec4d687aec4f0141663 Mon Sep 17 00:00:00 2001 From: BugraFiloglu Date: Mon, 2 Nov 2026 22:08:56 +0300 Subject: [PATCH 1/5] Week 04 hw --- Week04/functions_ilyas_bugra_filoglu.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Week04/functions_ilyas_bugra_filoglu.py diff --git a/Week04/functions_ilyas_bugra_filoglu.py b/Week04/functions_ilyas_bugra_filoglu.py new file mode 100644 index 00000000..5db3e209 --- /dev/null +++ b/Week04/functions_ilyas_bugra_filoglu.py @@ -0,0 +1,20 @@ +custom_pow = lambda a=0,/,e=1: a ** e + +def custom_equation(a: int = 0 , b: int = 0, / , x: int = 1, y: int = 1, * , z: int = 1) -> float: + return (a**x + b**y) / z + + +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 d66680fddfa9b1eebd2e67deea8609d7a41d0ed6 Mon Sep 17 00:00:00 2001 From: BugraFiloglu Date: Mon, 2 Nov 2026 22:11:20 +0300 Subject: [PATCH 2/5] Week 04 hw --- Week04/functions_ilyas_bugra_filoglu.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Week04/functions_ilyas_bugra_filoglu.py b/Week04/functions_ilyas_bugra_filoglu.py index 5db3e209..1d504202 100644 --- a/Week04/functions_ilyas_bugra_filoglu.py +++ b/Week04/functions_ilyas_bugra_filoglu.py @@ -1,7 +1,7 @@ -custom_pow = lambda a=0,/,e=1: a ** e +custom_power = lambda x=0,/,e=1: x ** e -def custom_equation(a: int = 0 , b: int = 0, / , x: int = 1, y: int = 1, * , z: int = 1) -> float: - return (a**x + b**y) / z +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]): From 449d7ef8e61bbec17c76f5e9db9d751c03a7fbc6 Mon Sep 17 00:00:00 2001 From: BugraFiloglu Date: Mon, 2 Nov 2026 22:13:02 +0300 Subject: [PATCH 3/5] Week 04 hw --- Week04/functions_ilyas_bugra_filoglu.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Week04/functions_ilyas_bugra_filoglu.py b/Week04/functions_ilyas_bugra_filoglu.py index 1d504202..9192eed6 100644 --- a/Week04/functions_ilyas_bugra_filoglu.py +++ b/Week04/functions_ilyas_bugra_filoglu.py @@ -1,7 +1,17 @@ -custom_power = lambda x=0,/,e=1: x ** e +custom_pow = lambda a=0,/,e=1: a ** 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(a: int = 0 , b: int = 0, / , x: int = 1, y: int = 1, * , z: int = 1) -> float: + """ + Calculate the custom equation (a**x + b**y) / z. + + :param a: first base + :param b: second base + :param x: first exponent + :param y: second exponent + :param z: divisor + :return: the computed float result + """ + return (a**x + b**y) / z def fn_w_counter() -> (int, dict[str, int]): From 2c619f500c2a8b2da85e41eb3276ea4789f954c5 Mon Sep 17 00:00:00 2001 From: BugraFiloglu Date: Mon, 2 Nov 2026 22:18:13 +0300 Subject: [PATCH 4/5] Week 04 hw --- Week04/functions_ilyas_bugra_filoglu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Week04/functions_ilyas_bugra_filoglu.py b/Week04/functions_ilyas_bugra_filoglu.py index 9192eed6..97548790 100644 --- a/Week04/functions_ilyas_bugra_filoglu.py +++ b/Week04/functions_ilyas_bugra_filoglu.py @@ -1,4 +1,4 @@ -custom_pow = lambda a=0,/,e=1: a ** e +custom_power = lambda a=0,/,e=1: a ** e def custom_equation(a: int = 0 , b: int = 0, / , x: int = 1, y: int = 1, * , z: int = 1) -> float: """ From bba8503012b8a6d53cb3f7acc96eaa1f32c91a5e Mon Sep 17 00:00:00 2001 From: BugraFiloglu Date: Mon, 2 Nov 2026 22:20:30 +0300 Subject: [PATCH 5/5] Week 04 hw Refactor custom_power and custom_equation parameters and logic. --- Week04/functions_ilyas_bugra_filoglu.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Week04/functions_ilyas_bugra_filoglu.py b/Week04/functions_ilyas_bugra_filoglu.py index 97548790..e97a1ba8 100644 --- a/Week04/functions_ilyas_bugra_filoglu.py +++ b/Week04/functions_ilyas_bugra_filoglu.py @@ -1,17 +1,17 @@ -custom_power = lambda a=0,/,e=1: a ** e +custom_power = lambda x=0,/,e=1: x ** e -def custom_equation(a: int = 0 , b: int = 0, / , x: int = 1, y: int = 1, * , z: int = 1) -> float: +def custom_equation(x: int = 0 , y: int = 0, / , a: int = 1, b: int = 1, * , c: int = 1) -> float: """ - Calculate the custom equation (a**x + b**y) / z. + Calculate the custom equation (x**a + y**b) / c. - :param a: first base - :param b: second base - :param x: first exponent - :param y: second exponent - :param z: divisor + :param x: first base + :param y: second base + :param a: first exponent + :param b: second exponent + :param c: divisor :return: the computed float result """ - return (a**x + b**y) / z + return (x**a + y**b) / c def fn_w_counter() -> (int, dict[str, int]):