Fix faulty circle_area function
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -9,4 +9,7 @@ def circle_area(radius: float):
|
|||||||
:raises ValueError: radius is negative
|
:raises ValueError: radius is negative
|
||||||
:return: area of the circle
|
:return: area of the circle
|
||||||
"""
|
"""
|
||||||
|
if radius < 0:
|
||||||
|
raise ValueError("Circle can't have negative radius")
|
||||||
|
|
||||||
return math.pi * radius ** 2
|
return math.pi * radius ** 2
|
||||||
|
|||||||
Reference in New Issue
Block a user