Skip to content

Commit a751f84

Browse files
authored
Week 04 hw
1 parent 9a399e7 commit a751f84

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
custom_pow = lambda a=0,/,e=1: a ** e
2+
3+
def custom_equation(a: int = 0 , b: int = 0, / , x: int = 1, y: int = 1, * , z: int = 1) -> float:
4+
return (a**x + b**y) / z
5+
6+
7+
def fn_w_counter() -> (int, dict[str, int]):
8+
9+
if not hasattr(fn_w_counter,'call_counter'):
10+
11+
fn_w_counter.call_counter = 0
12+
fn_w_counter.caller_dict = {}
13+
caller = __name__
14+
fn_w_counter.call_counter += 1
15+
16+
if caller in fn_w_counter.caller_dict:
17+
fn_w_counter.caller_dict[caller] += 1
18+
else:
19+
fn_w_counter.caller_dict[caller] = 1
20+
return fn_w_counter.call_counter,fn_w_counter.caller_dict

0 commit comments

Comments
 (0)