Skip to content

Commit c3df476

Browse files
functions_emir_karaduman
1 parent 71f5b39 commit c3df476

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Week04/emir_karaduman_functions

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
if not isinstance(x, int):
6+
raise TypeError("x must be int")
7+
if not isinstance(y, int):
8+
raise TypeError("y must be int")
9+
if not isinstance(a, int):
10+
raise TypeError("a must be int")
11+
if not isinstance(b, int):
12+
raise TypeError("b must be int")
13+
if not isinstance(c, int):
14+
raise TypeError("c must be int")
15+
16+
return (x ** a + y ** b) / c
17+
18+
_fn_w_counter_total = 0
19+
20+
def fn_w_counter():
21+
global _fn_w_counter_total
22+
_fn_w_counter_total += 1
23+
return _fn_w_counter_total, {__name__: _fn_w_counter_total}
24+
25+
fn_w_counter.__annotations__ = {"return": (int, dict[str, int])}

0 commit comments

Comments
 (0)