Skip to content

Commit 23b62ff

Browse files
authored
Merge pull request #64 from MustafaErenTugcu/patch-3
functions_mustafa_eren_tugcu.py
2 parents fe4037f + 9f6c7b2 commit 23b62ff

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
This function raises x to the power of a,
6+
adds y to the power of b,
7+
then divides this sum by c,
8+
and returns the result as a floating-point number.
9+
10+
:param x : First Number
11+
:param y : Second Number
12+
:param a : Third Number
13+
:param b : Fourth Number
14+
:param c : Fifth Number
15+
:return: result as a floating-point number.
16+
"""
17+
return float((x**a + y **b ) / c)
18+
19+
def fn_w_counter() -> (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_counts = {}
23+
24+
caller_name = __name__
25+
fn_w_counter.call_counter += 1
26+
27+
if caller_name in fn_w_counter.caller_counts:
28+
fn_w_counter.caller_counts[caller_name] += 1
29+
else:
30+
fn_w_counter.caller_counts[caller_name] = 1
31+
32+
return fn_w_counter.call_counter, fn_w_counter.caller_counts

0 commit comments

Comments
 (0)