Skip to content

Commit 429f2f3

Browse files
authored
Merge pull request #82 from iremdilsatkse/patch-3
Create functions_irem_dilsat_kose.py
2 parents 7f41977 + 60610b3 commit 429f2f3

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

Diff for: Week03/functions_irem_dilsat_kose.py

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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 computes the expression (x**a + y**b)/c
6+
7+
:param x:The first number, default is 0
8+
:type x:int
9+
:param y:The second number, default is 0
10+
:type y:int
11+
:param a:The third number, default is 1
12+
:type a:int
13+
:param b:The fourth number, default is 1
14+
:type b:int
15+
:param c:The fifth number, default is 1
16+
:type c:int
17+
:return: The result of the equation (x**a + y**b)/c
18+
:rtype: float
19+
20+
"""
21+
return (x**a + y**b) / c
22+
23+
def fn_w_counter() -> (int, dict[str,int]):
24+
if not hasattr(fn_w_counter,"call_counter"):
25+
fn_w_counter.call_counter = 0
26+
fn_w_counter.caller_counts = {}
27+
28+
caller_name = __name__
29+
fn_w_counter.call_counter +=1
30+
31+
if caller_name in fn_w_counter.caller_counts:
32+
fn_w_counter.caller_counts[caller_name] +=1
33+
34+
else:
35+
fn_w_counter.caller_counts[caller_name] =1
36+
37+
return fn_w_counter.call_counter, fn_w_counter.caller_counts

0 commit comments

Comments
 (0)