0 out of 464 challenges solved
Write a Python function `volume_cylinder` that calculates the volume of a cylinder given its radius and height. The formula for the volume of a cylinder is: \[ V = \pi \times r^2 \times h \] Where: - \( r \) is the radius of the cylinder's base. - \( h \) is the height of the cylinder. - \( \pi \) is approximately 3.1415. #### Function Signature ```python [main.nopy] def volume_cylinder(radius: float, height: float) -> float: pass ``` #### Example Usage ```python [main.nopy] print(volume_cylinder(10, 5)) # Expected output: 1570.75 print(volume_cylinder(4, 5)) # Expected output: 251.32 print(volume_cylinder(4, 10)) # Expected output: 502.64 ``` #### Constraints - The radius and height will always be positive numbers.
def volume_cylinder(radius: float, height: float) -> float: """ Calculate the volume of a cylinder given its radius and height. Args: radius (float): The radius of the cylinder's base. height (float): The height of the cylinder. Returns: float: The volume of the cylinder. """ # Placeholder for the solution pass