Skip to content

Commit d4dc294

Browse files
committed
Merge branch 'master' of https://github.com/SounaBYTE/Python
2 parents 43c56e4 + 2213427 commit d4dc294

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎maths/volume_of_cylinder.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import math
2+
3+
24
def volume_of_cylinder(radius: float, height: float) -> float:
35
"""
46
Calculate the volume of a cylinder.
@@ -13,8 +15,11 @@ def volume_of_cylinder(radius: float, height: float) -> float:
1315
"""
1416
if radius < 0 or height < 0:
1517
raise ValueError("Radius and height cannot be negative")
16-
volume = math.pi * (radius ** 2) * height
18+
volume = math.pi * (radius**2) * height
1719
return round(volume, 2)
20+
21+
1822
if __name__ == "__main__":
1923
import doctest
20-
doctest.testmod()
24+
25+
doctest.testmod()

0 commit comments

Comments
 (0)