Skip to content

Commit 24d5012

Browse files
authored
Create functions_beyza_sungar.py
1 parent fe4037f commit 24d5012

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Week03/functions_beyza_sungar.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
12+
and these parameters have default values:
13+
x = 0
14+
y = 0
15+
a = 1
16+
b = 1
17+
c = 1
18+
'''
19+
return float((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+
else:
32+
fn_w_counter.caller_counts[caller_name] =1
33+
34+
return fn_w_counter.call_counter, fn_w_counter.caller_counts

0 commit comments

Comments
 (0)