From 4f0f93e059d8b48bf5eeb8b40492b509374d6617 Mon Sep 17 00:00:00 2001 From: emrekayaa Date: Tue, 16 Dec 2025 00:38:46 +0300 Subject: [PATCH] Solved the first challenge of the workintech :) --- demo.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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