From f031f82eb95cff247682309636b6fbae1e431368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20alp=20=C3=96zdemir?= <109877223+akoalp@users.noreply.github.com> Date: Sun, 4 Jan 2026 11:04:57 +0300 Subject: [PATCH] Create functions_alp_ozdemir.py --- Week04/functions_alp_ozdemir.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Week04/functions_alp_ozdemir.py diff --git a/Week04/functions_alp_ozdemir.py b/Week04/functions_alp_ozdemir.py new file mode 100644 index 00000000..d65c5afa --- /dev/null +++ b/Week04/functions_alp_ozdemir.py @@ -0,0 +1,25 @@ +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: + """ + Calculates a specific equation based on inputs. + + :param x: The first base (positional only) + :param y: The second base (positional only) + :param a: The first exponent + :param b: The second exponent + :param c: The divisor (keyword only) + :return: The calculated float result + """ + + if not all(isinstance(arg, int) for arg in [x, y, a, b, c]): + raise TypeError("All arguments must be integers") + + return float((x ** a + y ** b) / c) + +_counter = 0 + +def fn_w_counter() -> (int, dict[str, int]): + global _counter + _counter += 1 + return _counter, {__name__: _counter}