Skip to content

Commit d5c6710

Browse files
authored
Create functions_zahra_ismayilli.py
1 parent 2024d08 commit d5c6710

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
/,
8+
a: int = 1,
9+
b: int = 1,
10+
*,
11+
c: int = 1
12+
) -> float:
13+
"""
14+
Calculate the result of the equation.
15+
16+
:param x: First integer.
17+
:param y: Second integer.
18+
:param a: Exponent of x.
19+
:param b: Exponent of y.
20+
:param c: Divisor.
21+
:return: The calculated result.
22+
:rtype: float
23+
"""
24+
return float((x ** a + y ** b) / c)
25+
26+
27+
def fn_w_counter() -> (int, dict[str, int]):
28+
if not hasattr(fn_w_counter, "counts"):
29+
fn_w_counter.counts = {}
30+
31+
caller_name = fn_w_counter.__module__
32+
33+
counts = fn_w_counter.counts
34+
counts[caller_name] = counts.get(caller_name, 0) + 1
35+
36+
return sum(counts.values()), counts.copy()

0 commit comments

Comments
 (0)