Skip to content

Commit 646dc26

Browse files
Create functions_bilal_ayakdas.py
1 parent fbaf99e commit 646dc26

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Week03/functions_bilal_ayakdas.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
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_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+
return fn_w_counter.call_counter, fn_w_counter.caller_counts
34+

0 commit comments

Comments
 (0)