write a python program to find the volume of a sphere with radius 8.5 CM
Answers
Answered by
3
Substitute the value of r in the expression to calculate volume.
from math import pi
radius = 8.5
volume = round(4/3 * pi * radius ** 3,2)
print('Volume of the sphere with radius',radius,'cm is:',volume,'cubic cm.')
- Math module contains the value of pi (constant).
- Here, we have imported the value of pi from math module. Then, we have calculated the volume of the sphere using formula.
- The volume of the sphere is then rounded off to 2 decimal places and it is displayed on the screen.
See attachment for output.
Attachments:
Similar questions