Skip to content

Commit a6bc91a

Browse files
committed
Task completed
1 parent f2dd454 commit a6bc91a

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Week04/functions_rukiye_ilhan.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
custom_power = lambda x=0, /, e=1: x ** e
2+
3+
4+
def custom_equation(x:int=0, y:int=0 , / ,a:int=1,b:int=1,*,c:int=1) -> float:
5+
"""
6+
"The function raises x to the power of a and y to the power of b, then adds the results together and divides the sum by c."
7+
8+
:param x: Positional-only base value for the first term; defaults to 0.
9+
:param y: Positional-only base value for the second term; defaults to 0.
10+
:param a: Exponent for `x`, can be used as positional or keyword; defaults to 1.
11+
:param b: Exponent for `y`, can be used as positional or keyword; defaults to 1.
12+
:param c: Keyword-only divisor for the result; defaults to 1.
13+
14+
:return: The result of the equation `(x**a + y**b) / c`.
15+
:rtype: float
16+
"""
17+
return (x**a + y**b) / c

0 commit comments

Comments
 (0)