Skip to content

Commit 57586f3

Browse files
authored
Merge pull request #553 from Extocraftor/patch-6
Create functions_mert_durgun.py
2 parents 93fc744 + 1df1524 commit 57586f3

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Week04/functions_mert_durgun.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
custom_power = lambda x=0,/,e=1 : x**e
2+
3+
def custom_equation(x: int = 0, y: int = 0, /, a: int = 1, b: int = 1, *, c: int = 1) -> float:
4+
"""
5+
:param x: The positional-only integer base for the first term, default is 0
6+
:param y: The positional-only integer base for the second term, default is 0
7+
:param a: The positional-or-keyword integer exponent for the first term, default is 1
8+
:param b: The positional-or-keyword integer exponent for the second term, default is 1
9+
:param c: The keyword-only integer divisor, default is 1
10+
:return: The result of the calculation as a float
11+
:rtype: float
12+
"""
13+
return (x**a + y**b) / c
14+
15+
16+
17+
18+
def fn_w_counter() -> (int, dict[str, int]):
19+
if not hasattr(fn_w_counter, "counter"):
20+
fn_w_counter.counter = 0
21+
fn_w_counter.dict = {}
22+
caller_name = __name__
23+
fn_w_counter.counter += 1
24+
if caller_name in fn_w_counter.dict:
25+
fn_w_counter.dict[caller_name] += 1
26+
else:
27+
fn_w_counter.dict[caller_name] = 1
28+
return fn_w_counter.counter, fn_w_counter.dict

0 commit comments

Comments
 (0)