Skip to content

Commit bba8503

Browse files
authored
Week 04 hw
Refactor custom_power and custom_equation parameters and logic.
1 parent 2c619f5 commit bba8503

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎Week04/functions_ilyas_bugra_filoglu.py‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
custom_power = lambda a=0,/,e=1: a ** e
1+
custom_power = lambda x=0,/,e=1: x ** e
22

3-
def custom_equation(a: int = 0 , b: int = 0, / , x: int = 1, y: int = 1, * , z: int = 1) -> float:
3+
def custom_equation(x: int = 0 , y: int = 0, / , a: int = 1, b: int = 1, * , c: int = 1) -> float:
44
"""
5-
Calculate the custom equation (a**x + b**y) / z.
5+
Calculate the custom equation (x**a + y**b) / c.
66
7-
:param a: first base
8-
:param b: second base
9-
:param x: first exponent
10-
:param y: second exponent
11-
:param z: divisor
7+
:param x: first base
8+
:param y: second base
9+
:param a: first exponent
10+
:param b: second exponent
11+
:param c: divisor
1212
:return: the computed float result
1313
"""
14-
return (a**x + b**y) / z
14+
return (x**a + y**b) / c
1515

1616

1717
def fn_w_counter() -> (int, dict[str, int]):

0 commit comments

Comments
 (0)