File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -29,14 +29,14 @@ def compute_geometric_mean(*args: int) -> float:
29
29
"""
30
30
product = 1
31
31
for number in args :
32
- if ( not isinstance (number , int )) and ( not isinstance (number , float ) ):
32
+ if not isinstance (number , int ) and not isinstance (number , float ):
33
33
raise TypeError ("Not a Number" )
34
34
product *= number
35
35
# Cannot calculate the even root for negative product.
36
36
# Frequently they are restricted to being positive.
37
37
if product < 0 and len (args ) % 2 == 0 :
38
38
raise ArithmeticError ("Cannot Compute Geometric Mean for these numbers." )
39
- mean = abs (product ) ** (1.0 / len (args ))
39
+ mean = abs (product ) ** (1 / len (args ))
40
40
# Since python calculates complex roots for negative products with odd roots.
41
41
if product < 0 :
42
42
mean = - mean
You can’t perform that action at this time.
0 commit comments