diff --git a/demo.py b/demo.py index 4592eec..b15e099 100644 --- a/demo.py +++ b/demo.py @@ -1,5 +1,9 @@ +import math -def circle_area(radius): - """Returns the area of the circle of given radius""" - pass # YOUR CODE HERE + +def circle_area(radius: float) -> float: + """Return the area of a circle. Negative radius returns 0.""" + if radius < 0: + return 0 + return math.pi * (radius ** 2) \ No newline at end of file