20 lines
290 B
Python
20 lines
290 B
Python
# Program sphere1.py
|
|
|
|
startUpMessage = '''
|
|
This program calculates the volume of a sphere.
|
|
|
|
'''
|
|
|
|
print(startUpMessage)
|
|
|
|
|
|
import math
|
|
PI = math.pi
|
|
|
|
radius = float(input("Enter the radius of a sphere "))
|
|
|
|
|
|
volume = 4 / 3 * PI * radius**3
|
|
|
|
print(f"The volume of the sphere is {volume:.2f}")
|