Skip to content

Commit 81596f3

Browse files
author
Seher Arslanbay
committed
functions seher arslanbay
1 parent ae739d6 commit 81596f3

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
custom_power = lambda x=0, /, e=1: x ** e
3+
4+
5+
def custom_equation(x: int = 0, y: int = 0, /, a: int = 1, b: int = 1, *, c: int = 1) -> float:
6+
"""
7+
Calculate the result of (x**a + y**b) / c.
8+
9+
:param x: First base
10+
:param y: Second base
11+
:param a: Exponent of x
12+
:param b: Exponent of y
13+
:param c: Divisor
14+
:return: Result of the equation as a float
15+
"""
16+
return (x ** a + y ** b) / c
17+
18+
19+
def fn_w_counter() -> tuple[int, dict[str, int]]:
20+
if not hasattr(fn_w_counter, "call_counter"):
21+
fn_w_counter.call_counter = 0
22+
fn_w_counter.caller_dict = {}
23+
24+
fn_w_counter.call_counter += 1
25+
26+
caller = __name__
27+
fn_w_counter.caller_dict[caller] = (
28+
fn_w_counter.caller_dict.get(caller, 0) + 1
29+
)
30+
31+
return fn_w_counter.call_counter, fn_w_counter.caller_dict

0 commit comments

Comments
 (0)