Do now

  • Create a function to calculate the volume of a sphere

In [8]:
def get_sphere(r):
    if r >= 0:
        return 4/3*math.pi*(r**2)
    else:
        print("Radius cannot be negative!")

In [11]:
get_sphere(3)


Out[11]:
37.69911184307752

In [ ]: