AnkitWebLogic

Calculate volume of cylinder | Python

Example 1: WAP in Python to input radius and height of a cylinder and calculate the volume of the cylinder. Volume=3.14*r*r*h. 1

# Calculate the volume of the cylinder | ankitweblogic.com
r=float(input("Enter Radius of a Cylinder:"))
h=float(input("Enter Height of a Cylinder:"))
v = 3.14 * r * r * h
print("Volume of Cylinder = ",v)
Enter Radius of a Cylinder:5
Enter Height of a Cylinder:7
Volume of Cylinder = 549.5
Advertisement