Added documantion and information to the programs
This commit is contained in:
parent
a2259b5b98
commit
db095e828d
4 changed files with 48 additions and 4 deletions
11
sphere1.py
11
sphere1.py
|
|
@ -1,3 +1,12 @@
|
|||
# Program sphere1.py
|
||||
|
||||
startUpMessage = '''
|
||||
This program calculates the volume of a sphere.
|
||||
|
||||
'''
|
||||
|
||||
print(startUpMessage)
|
||||
|
||||
|
||||
import math
|
||||
PI = math.pi
|
||||
|
|
@ -7,4 +16,4 @@ radius = float(input("Enter the radius of a sphere "))
|
|||
|
||||
volume = 4 / 3 * PI * radius**3
|
||||
|
||||
print(f"The volume of the sphere is {volume}")
|
||||
print(f"The volume of the sphere is {volume:.2f}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue