Skip to content
Closed
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
33 changes: 33 additions & 0 deletions Week04/functions_egehan_hatipoglu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
def custom_equation(x: int, y: int, a: int, b: int, c: int) -> float:
"""Calculates the custom equation.

:param x: first base
:type x: int
:param y: second base
:type y: int
:param a: first exponent
:type a: int
:param b: second exponent
:type b: int
:param c: divisor
:type c: int
:return: the result of (x**a + y**b) / c
:rtype: float
"""
return float((x**a + y**b) / c)


def fn_w_counter() -> tuple[int, dict[str, int]]:
if not hasattr(fn_w_counter, "total_count"):
fn_w_counter.total_count = 0
fn_w_counter.call_records = {}

caller = __name__
fn_w_counter.total_count += 1

if caller not in fn_w_counter.call_records:
fn_w_counter.call_records[caller] = 1
else:
fn_w_counter.call_records[caller] += 1

return fn_w_counter.total_count, fn_w_counter.call_records
Loading