diff --git a/demo.py b/demo.py index 4592eec..b78225e 100644 --- a/demo.py +++ b/demo.py @@ -1,5 +1,21 @@ +""" +Demo module for circle area calculation. +""" + +import math def circle_area(radius): - """Returns the area of the circle of given radius""" - pass # YOUR CODE HERE + """ + Calculate the area of a circle. + + Args: + radius (int or float): Radius of the circle + + Returns: + float: Area of the circle or 0 if radius is negative + """ + if radius < 0: + return 0 + + return math.pi * radius ** 2