Skip to content

Commit 49bdfff

Browse files
authored
Merge pull request #65 from bsungar/patch-4
Create functions_beyza_sungar.py
2 parents 23b62ff + 9a49bbb commit 49bdfff

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Week03/functions_beyza_sungar.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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 returns x to the power of a plus y to the power of b divided by c,
6+
:param x : is the first number
7+
:param y : is the second number
8+
:param a : is the third number
9+
:param b : is the fourth number
10+
:param c : is the fifth number
11+
:return : As a floating-point number.
12+
13+
'''
14+
return float((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_counts = {}
20+
21+
caller_name = __name__
22+
fn_w_counter.call_counter +=1
23+
24+
if caller_name in fn_w_counter.caller_counts:
25+
fn_w_counter.caller_counts[caller_name] +=1
26+
else:
27+
fn_w_counter.caller_counts[caller_name] =1
28+
29+
return fn_w_counter.call_counter, fn_w_counter.caller_counts

0 commit comments

Comments
 (0)