From bb963f49db7f1e2d5436ff6cf0c2d6c07b0180cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Egehan=20Hatipo=C4=9Flu?= Date: Sun, 1 Nov 2026 18:48:56 +0300 Subject: [PATCH] Create functions_egehan_hatipoglu.py --- Week04/functions_egehan_hatipoglu.py | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Week04/functions_egehan_hatipoglu.py diff --git a/Week04/functions_egehan_hatipoglu.py b/Week04/functions_egehan_hatipoglu.py new file mode 100644 index 00000000..e97a1ba8 --- /dev/null +++ b/Week04/functions_egehan_hatipoglu.py @@ -0,0 +1,30 @@ +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: + """ + Calculate the custom equation (x**a + y**b) / c. + + :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 (x**a + y**b) / c + + +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