Skip to content

Commit 1aef47b

Browse files
Create functions_mehmet_mert_yigit.py
1 parent 2024d08 commit 1aef47b

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import inspect
2+
3+
4+
custom_power = lambda x=0, e=1, /: x ** e
5+
6+
7+
def custom_equation(
8+
x: int,
9+
y: int = 0,
10+
/,
11+
a: int = 1,
12+
b: int = 1,
13+
*,
14+
c: int = 1
15+
) -> float:
16+
"""
17+
Calculate the result of the equation.
18+
19+
:param x: First integer.
20+
:param y: Second integer.
21+
:param a: Exponent of x.
22+
:param b: Exponent of y.
23+
:param c: Divisor.
24+
:return: Result of the equation.
25+
:rtype: float
26+
"""
27+
return float((x ** a + y ** b) / c)
28+
29+
30+
def fn_w_counter():
31+
if not hasattr(fn_w_counter, "counts"):
32+
fn_w_counter.counts = {}
33+
34+
caller = inspect.currentframe().f_back
35+
caller_name = caller.f_code.co_name
36+
37+
counts = fn_w_counter.counts
38+
counts[caller_name] = counts.get(caller_name, 0) + 1
39+
40+
return sum(counts.values()), counts.copy()

0 commit comments

Comments
 (0)