Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Week04/functions_veli_unusdu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
custom_power = lambda x=0, /, e=1: x**e
"""lambda x=0 / e=1 → x**e"""


def custom_equation(x: int = 0, y: int = 0, /, a: int = 1, b: int = 1, *, c: int = 1) -> float:
"""(x**a + y**b) / c"""
return (x**a + y**b) / c


def fn_w_counter() -> tuple[int, dict[str, int]]:
caller = __name__ if __name__ != "<lambda>" else "lambda"
fn_w_counter.total = getattr(fn_w_counter, "total", 0) + 1
fn_w_counter.callers = getattr(fn_w_counter, "callers", {})
fn_w_counter.callers[caller] = fn_w_counter.callers.get(caller, 0) + 1
return fn_w_counter.total, fn_w_counter.callers.copy()
134 changes: 0 additions & 134 deletions Week04/test_functions.py

This file was deleted.