Answer to Question #200004 in Python for Phenomenal

Question #200004

The volume of a sphere is 4/3 pi r cube. write a function called print_volume(r) that takes an argument for the radius of the sphere and print the volume of the sphere. Call your print_volume function three times with different values for radius


1
Expert's answer
2021-05-28T10:31:21-0400
def print_volume(r):
    print('The volume of a sphere for radius',r,'is', 
          '{:.2f}'.format((4.0/3.0) * 3.1415926 * r * r * r))

print_volume(1)
print_volume(2)
print_volume(3.14)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS