示例#1
0
def main():
    radius = getInputs()
    sphere = Sphere(radius)
    surface = sphere.surfaceArea()
    vol = sphere.volume()

    print("\nSurface Area: {0:0.3f} \nVolume: {1:0.3f}".format(surface, vol))
示例#2
0
def main():
    r = eval(input("What is the radius of your sphere?  "))
    s = Sphere(r)
    A = s.surfaceArea()
    V = s.volume()
    print("The volume of your sphere is {0:0.1f}.".format(V))
    print("The area of your sphere is {0:0.1f}.".format(A))
def main():
    print("This program calculates the volume and surface area of a sphere.")
    radius = eval(input("Please enter a radius: "))
    sphere = Sphere(radius)

    print("The volume is", sphere.volume(), " and the surface area is",
          sphere.surfaceArea())
def main(args):
    radius = int(args[1])

    print("The radius of the sphere is %d" % (radius))
    s1 = Sphere(radius)
    print("The surface area of sphere is ", s1.surfaceArea())
    print("The volume of sphere is ", s1.volume())