Skip to content

Commit 3c656c2

Browse files
authored
Create functions_abdulsamet_kucuk.py
1 parent 71f5b39 commit 3c656c2

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
custom_power = lambda x=0, /, e=1: x**e
2+
3+
4+
def custom_equation(
5+
x: int = 0,
6+
y: int = 0,
7+
a: int = 1,
8+
b: int = 1,
9+
*,
10+
c: int = 1,
11+
) -> float:
12+
"""
13+
:param x: first value
14+
:param y: second value
15+
:param a: multiplier for x
16+
:param b: multiplier for y
17+
:param c: divisor
18+
:return: result of the equation
19+
"""
20+
if not all(isinstance(v, int) for v in (x, y, a, b, c)):
21+
raise TypeError("all parameters must be int")
22+
return (a * x + b * y + x + y) / c
23+
24+
25+
def fn_w_counter() -> (int, dict[str, int]):
26+
if not hasattr(fn_w_counter, "_counter"):
27+
fn_w_counter._counter = 0
28+
fn_w_counter._counter += 1
29+
module_name = __name__.split(".")[-1]
30+
return fn_w_counter._counter, {module_name: fn_w_counter._counter}

0 commit comments

Comments
 (0)