Skip to content

Commit 3fe9bc8

Browse files
W5HWV4
1 parent b3d2e97 commit 3fe9bc8

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

‎Week04/decorators_umut_turk.py‎

Whitespace-only changes.

‎Week04/functions_umut_turk.py‎

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+
"""_summary_
5+
6+
Args:
7+
x (int, optional): _description_. Defaults to 0. positional only
8+
y (int, optional): _description_. Defaults to 0. positional only
9+
a (int, optional): _description_. Defaults to 1. positional or keyword
10+
b (int, optional): _description_. Defaults to 1. positional or keyword
11+
c (int, optional): _description_. Defaults to 1. keyword only
12+
13+
Returns:
14+
float: _description_
15+
x**a + y**b / c
16+
"""
17+
return (x**a + y**b) / c
18+
19+
def fn_w_counter():
20+
if not hasattr(fn_w_counter, "counter"):
21+
fn_w_counter.counter = 0
22+
fn_w_counter.counter += 1
23+
return (fn_w_counter.counter, {fn_w_counter.__module__: fn_w_counter.counter})
24+
if __name__ == "__main__":
25+
print(fn_w_counter())

0 commit comments

Comments
 (0)