Python Density of Cylinder Program

Write a program to input mass and volume of a cylinder and find the density of this cylinder using the formula d = m / v:

### Formulae of Density of Cylinder

We will use the following formula for the calculation of density of the cylinder.

Density = Mass / Volume

## Code ofÂ Python Density of Cylinder Program

''' Python Program to calculate Density of Cylinder using formulae: Density = Mass / Volume ''' print("Enter Mass of the Cylinder:") mass = float(input("Enter the Mass of the Cylinder:")) ; volume = float(input("Enter the Volume of the Cylinder:")) ; density = mass / volume density = round(density,4) print("Density of cylinder =", density)

### Output

Enter Mass of the Cylinder:

Enter the Mass of the Cylinder:456

Enter the Volume of the Cylinder:200

Density of cylinder = 2.28

#### How this program works

First of all, the program shows a message to enter the mass of a cylinder. Similarly, a second prompt will ask for entering the volume of this cylinder.

Then program will use the formula:

density = mass / volume

The result that is density of cylinder will be displayed on the scree.

## More easy Python Programs

Here is a list of Python programs. These programs are easy to understand for beginners. The reading of programming tutorials helps building the program logic.

- Python Program Prime Between Two Numbers
- Python Program Digits Product
- Python KG to POUNDS and Vice Versa
- Function Array Search in C Plus Plus
- Python Remove Vowels in String Program
- Python Convert Millimeters to Inches using Function
- Python Count Each Vowel in Text File Program
- Python Four Function Calculator GUI Program
- Python Area of Triangle With Three Sides Formula
- Python Print Star Patterns 14 Programs
- Python Number Guess Game Project Made Easy
- Python Prime Factors Program

704 total views, 1 views today