Skip to content

Commit 5ca3ddf

Browse files
committed
Bug fixing
1 parent 02c75cb commit 5ca3ddf

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Week04/decorators_tarik_bozgan.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
def performance(func):
55
def wrapper(*args, **kwargs):
66
tracemalloc.start()
7-
t1 = time.perf_counter()
7+
start = time.perf_counter()
88

99
result = func(*args, **kwargs)
1010

11-
t2 = time.perf_counter()
12-
curr, peak = tracemalloc.get_traced_memory()
11+
end = time.perf_counter()
12+
current, peak = tracemalloc.get_traced_memory()
1313
tracemalloc.stop()
1414

1515
wrapper.counter += 1
16-
wrapper.total_time += t2 - t1
16+
wrapper.total_time += (end - start)
1717
wrapper.total_mem += peak
1818

1919
return result

Week04/functions_tarik_bozgan.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# x parametresine =0 ekledik, testin istediği bu.
12
custom_power = lambda x=0, /, e=1: x ** e
23

34
def custom_equation(x: int = 0, y: int = 0, /, a: int = 1, b: int = 1, *, c: int = 1) -> float:
@@ -15,7 +16,7 @@ def custom_equation(x: int = 0, y: int = 0, /, a: int = 1, b: int = 1, *, c: int
1516
if not isinstance(b, int): raise TypeError("b must be int")
1617
if not isinstance(c, int): raise TypeError("c must be int")
1718

18-
return (x ** a + y ** b) / c
19+
return float((x ** a + y ** b) / c)
1920

2021
_count = 0
2122
def fn_w_counter() -> (int, dict[str, int]):

0 commit comments

Comments
 (0)