Skip to content

Commit 9bb2425

Browse files
authored
Merge pull request canbula#560 from gorendes/patch-4
Create functions_niyazi_cetinkaya.py
2 parents dcc00d2 + 73ca0f6 commit 9bb2425

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+
Calculate a custom equation based on the provided parameters.
6+
7+
The function computes the result of the equation:
8+
(x**a + y**b) / c
9+
10+
:param x: The first integer value (positional-only, default is 0).
11+
:param y: The second integer value (positional-only, default is 0).
12+
:param a: The exponent for x (positional or keyword, default is 1).
13+
:param b: The exponent for y (positional or keyword, default is 1).
14+
:param c: The divisor (keyword-only, default is 1).
15+
:return: The result of the equation as a float.
16+
"""
17+
return (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_count_dict = {}
23+
24+
caller = __name__
25+
fn_w_counter.call_counter += 1
26+
27+
if caller not in fn_w_counter.caller_count_dict:
28+
fn_w_counter.caller_count_dict[caller] = 1
29+
else:
30+
fn_w_counter.caller_count_dict[caller] += 1
31+
32+
return fn_w_counter.call_counter, fn_w_counter.caller_count_dict

0 commit comments

Comments
 (0)