Skip to content

Commit 7c31fe2

Browse files
authored
Merge pull request #730 from dilekk1/patch-15
Create functions_dilek_celebi.py
2 parents e83851f + e0c2e41 commit 7c31fe2

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Week04/functions_dilek_celebi.py

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

0 commit comments

Comments
 (0)