Advertisements
Advertisements
Question
Which data type will be used to represent the following data values and why?
Volume of a sphere
Short/Brief Note
Advertisements
Solution
The float data type will be used to represent the 'Volume of a sphere'.
The formula for the volume of a sphere:
Volume of sphere, `"V" = 4/3π"r"^3`
Even if 'r' is a whole number, the value of volume can be a fraction which can be represented in a decimal form easily by float data type.
shaalaa.com
Python Data Types
Is there an error in this question or solution?
