Skip to content

Commit

Permalink
Update functions_burak_talha_memis.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Buraktalhaa authored Mar 17, 2024
1 parent 26b62d4 commit 88d028c
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions Week03/functions_burak_talha_memis.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
custom_power = lambda x = 0,/,e = 1: x**e

def custom_equation(x = 0,y = 0,/,a = 1,b = 1, * ,c = 1)->float:
def custom_equation(x:int = 0, y:int = 0, /, a:int = 1, b:int = 1, *, c:int = 1) -> float:
"""
This function
:param x:The first number, default is 0
Expand All @@ -18,18 +18,16 @@ def custom_equation(x = 0,y = 0,/,a = 1,b = 1, * ,c = 1)->float:
"""
return (x**a + y**b) / c

def fn_w_counter() -> (int, dict[str,int]):
if not hasattr(fn_w_counter, 'counter'):
fn_w_counter.counter = 0

fn_w_counter.counter += 1

if not hasattr(fn_w_counter, 'callers'):
fn_w_counter.callers = {f"{__name__}": 1}
def fn_w_counter() -> (int, dict[str, int]):
if not hasattr(fn_w_counter, "call_count"):
fn_w_counter.call_count = 0
fn_w_counter._dict = {}
caller_name = __name__
fn_w_counter.call_count += 1
if caller_name in fn_w_counter._dict:
fn_w_counter._dict[caller_name] += 1
else:
if __name__ in fn_w_counter.callers:
fn_w_counter.callers[__name__] += 1
else:
fn_w_counter.callers[__name__] = 1
fn_w_counter._dict[caller_name] = 1
return fn_w_counter.call_count, fn_w_counter._dict


0 comments on commit 88d028c

Please sign in to comment.