Added documentation and information to the programs
This commit is contained in:
parent
ba1c8d6d86
commit
ca0492fb72
4 changed files with 70 additions and 0 deletions
19
homework06/git-practice/sphere1.py
Normal file
19
homework06/git-practice/sphere1.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# 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}")
|
||||
Loading…
Add table
Add a link
Reference in a new issue