menu search
brightness_auto
more_vert
3 1

The volume of a sphere with radius r is 4/3πr3. Write a Python program to find the volume of spheres with radius 7cm, 12cm, 16cm, respectively.

Topic Python Programming
Type Python Program
Class 11
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike

1 Answer

more_vert
0

#defining three different radius using variables r1, r2, r3

r1 = 7

r2 = 12

r3 = 16

#calculating the volume using the formula

volume1 = (4/3*22/7*r1**3)

volume2 = (4/3*22/7*r2**3)

volume3 = (4/3*22/7*r3**3)

#printing the volume after using the round function to two decimal place for better readability

print("When the radius is",r1,"cm, the volume of the sphere will be", round(volume1,2),"cc")

print("When the radius is",r2,"cm, the volume of the sphere will be", round(volume2,2),"cc")

print("When the radius is",r3,"cm, the volume of the sphere will be", round(volume3,2),"cc")


Study more about Python at Python Class 10

thumb_up_off_alt 0 like thumb_down_off_alt 0 dislike

Related questions

thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
1 answer
Welcome to Aiforkids, where you can ask questions and receive answers from other members of the community.

AI 2024 Class 10 Board Exams mein 100% laane ka plan OPEN NOW

Class 10 Complete One Shot AI Lectures at - Youtube
...