Skip to content

Commit f4cd167

Browse files
calculate circle area
1 parent 8ef2c65 commit f4cd167

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

maths/area.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
def circle_area(radius: float) -> float:
2+
"""
3+
>>> circle_area(10)
4+
314.1592653589793
5+
>>> circle_area(0)
6+
0.0
7+
"""
8+
import math
9+
return math.pi * radius * radius
10+
11+
12+
if __name__ == "__main__":
13+
from doctest import testmod
14+
15+
testmod()

0 commit comments

Comments
 (0)