Skip to content

Commit c69ef03

Browse files
authored
Merge pull request #69 from Buraktalhaa/patch-2
Create functions_burak_talha_memis.py
2 parents 0abc160 + 88d028c commit c69ef03

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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
6+
:param x:The first number, default is 0
7+
:type x: int
8+
:param y:The second number, default is 0
9+
:type y: int
10+
:param a:The third number, default is 1
11+
:type a: int
12+
:param b:The fourth number, default is 1
13+
:type b: int
14+
:param c:The fifth number, default is 1
15+
:type c: int
16+
:return:The sum of 'x' power 'a' and 'y' power 'b' divided by c
17+
:rtype:float
18+
"""
19+
return (x**a + y**b) / c
20+
21+
def fn_w_counter() -> (int, dict[str, int]):
22+
if not hasattr(fn_w_counter, "call_count"):
23+
fn_w_counter.call_count = 0
24+
fn_w_counter._dict = {}
25+
caller_name = __name__
26+
fn_w_counter.call_count += 1
27+
if caller_name in fn_w_counter._dict:
28+
fn_w_counter._dict[caller_name] += 1
29+
else:
30+
fn_w_counter._dict[caller_name] = 1
31+
return fn_w_counter.call_count, fn_w_counter._dict
32+
33+

0 commit comments

Comments
 (0)