Computer Science, asked by atahrv, 7 months ago

Please answer this question.
Language - Python
Best answer will be marked as Brainlest.
Don't Spam.

Attachments:

Answers

Answered by Shs07
3

Python program:

To calculate volume of a container, given its radius.

#Enter radius and then height

#Then press 1 for type 1 or 2 for Type 2 container.

r = float(input("Enter radius of the container:"))

h = float(input("Enter height of the container:"))

type = int(input("Enter type of the container:"))

vol1 = 3.14*r*h

vol2 = 3.14*r*h/3

if type == 1 :

print("volume of the container is", vol1)

elif type == 2 :

print("volume of the container is", vol2)

else :

print("Please enter valid inputs")

#Program ended

Hope this helps !

Answered by temporarygirl
1

Hola mate

Here is your answer -

To calculate volume of a container, given its radius.

#Enter radius and then height

#Then press 1 for type 1 or 2 for Type 2 container.

r = float(input("Enter radius of the container:"))

h = float(input("Enter height of the container:"))

type = int(input("Enter type of the container:"))

vol1 = 3.14*r*h

vol2 = 3.14*r*h/3

if type == 1 :

print("volume of the container is", vol1)

elif type == 2 :

print("volume of the container is", vol2)

else :

print("Please enter valid inputs")

#Program ended

Similar questions