Skip to content

Commit

Permalink
Merge pull request #69 from Buraktalhaa/patch-2
Browse files Browse the repository at this point in the history
Create functions_burak_talha_memis.py
  • Loading branch information
canbula authored Mar 21, 2024
2 parents 0abc160 + 88d028c commit c69ef03
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Week03/functions_burak_talha_memis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
custom_power = lambda x = 0,/,e = 1: x**e

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
:type x: int
:param y:The second number, default is 0
:type y: int
:param a:The third number, default is 1
:type a: int
:param b:The fourth number, default is 1
:type b: int
:param c:The fifth number, default is 1
:type c: int
:return:The sum of 'x' power 'a' and 'y' power 'b' divided by c
:rtype:float
"""
return (x**a + y**b) / c

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:
fn_w_counter._dict[caller_name] = 1
return fn_w_counter.call_count, fn_w_counter._dict


0 comments on commit c69ef03

Please sign in to comment.