Skip to content

Commit 426e384

Browse files
authored
Implement custom_equation function
Adds a function to calculate a custom mathematical equation.
1 parent 71f5b39 commit 426e384

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
def custom_equation(
2+
x: int = 0,
3+
y: int = 0,
4+
/,
5+
a: int = 1,
6+
b: int = 1,
7+
*,
8+
c: int = 1
9+
) -> float:
10+
"""
11+
Calculates a custom mathematical equation.
12+
13+
:param x: First positional-only integer value.
14+
:param y: Second positional-only integer value.
15+
:param a: Exponent for x.
16+
:param b: Exponent for y.
17+
:param c: Divisor value.
18+
:return: The result of (x**a + y**b) / c as a float.
19+
"""
20+
return (x ** a + y ** b) / c

0 commit comments

Comments
 (0)