From 14a0d63692e2641e16dadd58f7ed368098b66eb1 Mon Sep 17 00:00:00 2001 From: Emir Ozer Date: Wed, 4 Nov 2026 10:28:57 +0300 Subject: [PATCH 1/2] Add custom power and equation funtions --- Week04/functions_nazmi_emir_ozer.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Week04/functions_nazmi_emir_ozer.py diff --git a/Week04/functions_nazmi_emir_ozer.py b/Week04/functions_nazmi_emir_ozer.py new file mode 100644 index 00000000..5611aa82 --- /dev/null +++ b/Week04/functions_nazmi_emir_ozer.py @@ -0,0 +1,28 @@ +import os + +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 returns a mathematical equation + + :param x:first number to be exponentiated + :param y:second number to be exponentiated + :param a:power of the first number + :param b:power of the second number + :param c:divisor of the sum of exponentiated + :return:returns the result of the equation + + """ + return (x**a + y**b) / c + + +caller_dict = {} +call_counter = 0 + +def fn_w_counter() -> (int, dict[str, int]): + caller = __name__ + global call_counter + call_counter += 1 + caller_dict[caller] = caller_dict.get(caller, 0) + 1 + return call_counter, caller_dict \ No newline at end of file From 6805b3a0e88df8325fbc6e6942605a43b1489619 Mon Sep 17 00:00:00 2001 From: Emir Ozer Date: Wed, 4 Nov 2026 10:35:04 +0300 Subject: [PATCH 2/2] Fix docstring return count --- Week04/functions_nazmi_emir_ozer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Week04/functions_nazmi_emir_ozer.py b/Week04/functions_nazmi_emir_ozer.py index 5611aa82..fcbd23c1 100644 --- a/Week04/functions_nazmi_emir_ozer.py +++ b/Week04/functions_nazmi_emir_ozer.py @@ -11,7 +11,7 @@ def custom_equation(x: int=0 ,y: int=0,/,a: int=1,b: int=1,*,c: int=1) ->float: :param a:power of the first number :param b:power of the second number :param c:divisor of the sum of exponentiated - :return:returns the result of the equation + :return:the result of the equation """ return (x**a + y**b) / c