1- # custom_power (lambda)
2- custom_power = lambda x = 0 , e = 1 : x ** e
1+ custom_power = lambda x , / , e = 1 : x ** e
32
4-
5- def custom_equation (
6- x : int = 0 ,
7- y : int = 0 ,
8- a : int = 1 ,
9- b : int = 1 ,
10- * ,
11- c : int = 1
12- ) -> float :
3+ def custom_equation (x : int = 0 , y : int = 0 , / , a : int = 1 , b : int = 1 , * , c : int = 1 ) -> float :
134 """
14- :param x: integer value
15- :param y: integer value
16- :param a: integer value
17- :param b: integer value
18- :param c: integer value
19- :return: result of equation
5+ :param x:
6+ :param y:
7+ :param a:
8+ :param b:
9+ :param c:
10+ :return:
2011 """
21- if not all (isinstance (v , int ) for v in (x , y , a , b , c )):
22- raise TypeError ("All parameters must be int" )
23-
12+ if not isinstance (x , int ): raise TypeError ("x must be int" )
13+ if not isinstance (y , int ): raise TypeError ("y must be int" )
14+ if not isinstance (a , int ): raise TypeError ("a must be int" )
15+ if not isinstance (b , int ): raise TypeError ("b must be int" )
16+ if not isinstance (c , int ): raise TypeError ("c must be int" )
17+
2418 return (x ** a + y ** b ) / c
2519
26-
27- _call_count = 0
28-
20+ _count = 0
2921def fn_w_counter () -> (int , dict [str , int ]):
30- global _call_count
31- _call_count += 1
32- return _call_count , {__name__ : _call_count }
22+ global _count
23+ _count += 1
24+ return _count , {__name__ : _count }
0 commit comments