English

Which data type will be used to represent the following data values and why? Volume of a sphere - Computer Science (Python)

Advertisements
Advertisements

Question

Which data type will be used to represent the following data values and why?

Volume of a sphere

Short Note

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?
Chapter 5: Getting Started with Python - Exercise [Page 116]

APPEARS IN

NCERT Computer Science [English] Class 11
Chapter 5 Getting Started with Python
Exercise | Q 6. (e) | Page 116
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×