Skip to content

Commit 9e3b775

Browse files
authored
Merge pull request #772 from ezberaysegul/patch-18
Create functions_aysegul_ezber.py
2 parents 0698aac + 25c49c4 commit 9e3b775

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Week04/functions_aysegul_ezber.py

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

0 commit comments

Comments
 (0)