from math import pi
def print_volume(r):
return (4 / 3) * pi * r**3
r1, r2, r3 = 1, 2, 3
print("Result for r=", r1, ": ", print_volume(r1), sep='')
print("Result for r=", r2, ": ", print_volume(r2), sep='')
print("Result for r=", r3, ": ", print_volume(r3), sep='')
Comments
Leave a comment