Skip to content

Commit 5c2bd18

Browse files
Create functions_irem_dilsat_kose.py
1 parent fbaf99e commit 5c2bd18

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
custom_power = lambda x, e=1 : x**e
2+
3+
def custom_equation(x, y, /, a=1, b=1, *, c=1)-> float:
4+
"""
5+
This function computes the expression (x**a + y**b)/c
6+
7+
:param x:The first number, default=0
8+
:type x:int
9+
:param y:The second number, default=0
10+
:type y:int
11+
:param a:The third number, default=1
12+
:type a:int
13+
:param b:The fourth number, default=1
14+
:type b:int
15+
:param c:The fifth number, default=1
16+
:type c:int
17+
18+
"""
19+
return (x**a + y**b) / c
20+
21+
def fn_w_counter() -> (int, dict[str,int]):
22+
if not hasattr(fn_w_counter,"call_counter"):
23+
fn_w_counter.call_counter = 0
24+
fn_w_counter.caller_counts = {}
25+
26+
caller_name = __name__
27+
fn_w_counter.call_counter +=1
28+
29+
if caller_name in fn_w_counter.caller_counts:
30+
fn_w_counter.caller_counts[caller_name] +=1
31+
32+
else:
33+
fn_w_counter.caller_counts[caller_name] =1
34+
35+
return fn_w_counter.call_counter, fn_w_counter.caller_counts

0 commit comments

Comments
 (0)