Skip to content

Commit 94d1572

Browse files
Create functions_mustafa_eren_tugcu.py
1 parent 313658c commit 94d1572

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from collections import defaultdict
2+
from typing import Tuple, Dict
3+
4+
custom_power = lambda x = 0 , / ,e = 1, : x**e
5+
6+
def custom_equation(x: int = 0, y: int = 0, /, a: int = 1, b: int = 1, *, c: int = 1 ) -> float :
7+
"""
8+
This function raises x to the power of a,
9+
adds y to the power of b,
10+
then divides this sum by c,
11+
and returns the result as a floating-point number.
12+
13+
:param x : First Number
14+
:param y : Second Number
15+
:param a : Third Number
16+
:param b : Fourth Number
17+
:param c : Fifth Number
18+
:return: result as a floating-point number.
19+
"""
20+
return float((x**a + y **b ) / c)
21+
22+
def fn_w_counter() -> (int, dict[str, int]):
23+
if not hasattr(fn_w_counter, "call_counter"):
24+
fn_w_counter.call_counter = 0
25+
fn_w_counter.caller_counts = {}
26+
27+
caller_name = __name__
28+
fn_w_counter.call_counter += 1
29+
30+
if caller_name in fn_w_counter.caller_counts:
31+
fn_w_counter.caller_counts[caller_name] += 1
32+
else:
33+
fn_w_counter.caller_counts[caller_name] = 1
34+
35+
return fn_w_counter.call_counter, fn_w_counter.caller_counts

0 commit comments

Comments
 (0)