In [1]:
from math import pi
In [6]:
def volume_sphere(r):
if r > 0:
return (4/3) * pi * (r**3)
else:
return "No radius"
In [9]:
volume_sphere(2)
Out[9]: