Computer Science

Write a program to input the radius of a sphere and calculate its volume (V = 4/3πr3)

Python

Python Data Handling

45 Likes

Answer

import math

r = float(input("Enter radius of sphere: "))
v = 4 / 3 * math.pi * r ** 3

print("Volume of sphere = ", v)

Output

Enter radius of sphere: 3.5
Volume of sphere =  179.59438003021648

Answered By

21 Likes


Related Questions