Lesson 1 of 16

Density and Specific Gravity

Density and Specific Gravity

Density is the mass per unit volume of a substance:

ρ=mV\rho = \frac{m}{V}

where mm is mass in kilograms and VV is volume in cubic metres. The SI unit of density is kg/m³.

Common Densities

SubstanceDensity (kg/m³)
Air (sea level)1.225
Ethanol789
Water (4 °C)1000
Seawater~1025
Mercury13 546

Specific Gravity

Specific gravity (SG) is the dimensionless ratio of a substance's density to that of pure water at standard conditions (ρwater=1000kg/m3\rho_{\text{water}} = 1000\,\text{kg/m}^3):

SG=ρρwaterSG = \frac{\rho}{\rho_{\text{water}}}

A specific gravity greater than 1 means the substance is denser than water and will sink; less than 1 means it will float.

Examples

Substanceρ\rho (kg/m³)SG
Ethanol7890.789
Water10001.000
Mercury13 54613.546

Your Task

Implement density(mass, volume) that returns density in kg/m³, and specific_gravity(rho) that returns the dimensionless specific gravity relative to water.

Python runtime loading...
Loading...
Click "Run" to execute your code.