|
| 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 | + """ |
| 5 | + This function raises x to the power of a, |
| 6 | + adds y to the power of b, |
| 7 | + then divides this sum by c, |
| 8 | + and returns the result as a floating-point number. |
| 9 | + |
| 10 | + :param x : First Number |
| 11 | + :param y : Second Number |
| 12 | + :param a : Third Number |
| 13 | + :param b : Fourth Number |
| 14 | + :param c : Fifth Number |
| 15 | + :return: result as a floating-point number. |
| 16 | + """ |
| 17 | + return float((x**a + y **b ) / c) |
| 18 | + |
| 19 | +def fn_w_counter() -> (int, dict[str, int]): |
| 20 | + if not hasattr(fn_w_counter, "call_counter"): |
| 21 | + fn_w_counter.call_counter = 0 |
| 22 | + fn_w_counter.caller_counts = {} |
| 23 | + |
| 24 | + caller_name = __name__ |
| 25 | + fn_w_counter.call_counter += 1 |
| 26 | + |
| 27 | + if caller_name in fn_w_counter.caller_counts: |
| 28 | + fn_w_counter.caller_counts[caller_name] += 1 |
| 29 | + else: |
| 30 | + fn_w_counter.caller_counts[caller_name] = 1 |
| 31 | + |
| 32 | + return fn_w_counter.call_counter, fn_w_counter.caller_counts |
0 commit comments