From 398922b31915a0aa61eaf0881caff05f5d9d7002 Mon Sep 17 00:00:00 2001 From: Senem Yilmaz Date: Tue, 16 Dec 2025 13:14:19 +0300 Subject: [PATCH] Implement circle_area function --- demo.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) 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