Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- Write definitions for these functions:
- sphereArea(radius) Returns the surface area of a sphere having the given radius.
- sphereVolume(radius) Returns the volume of a sphere having the given radius.
- Use your functions to solve Programming Exercise 1 from Chapter 3.
- """
- import math
- def sphere_Area(radius):
- A = 4 * math.pi * radius ** 2
- return A
- def sphere_Volume(radius):
- V = 4/3 * math.pi * radius ** 3
- return V
- def main():
- radius = eval(input("Enter the radius: "))
- A = sphere_Area(radius)
- V = sphere_Volume(radius) # Define user defined functions in main
- print("Area of the Sphere is: ",round(A,2))
- print("Volume of the Sphere is: ",round(V,2))
- main()
Add Comment
Please, Sign In to add comment