InterviewSolution
Saved Bookmarks
| 1. |
Q.Write a function that: (i) Asks the user to input a diameter of a sphere (centimetres,inches, etc.)(ii) Sets a variable called radius to one-half of the number(iii) Calculates the volume of a sphere using this radius and theformula:Volume = 4/3 pi*r*3(iv) Prints a statement estimating the volume of the sphere;include the appropriate unit information in litres or quarts(Note that here are 1000 cubic cm in a litre and 57.75 cubic inches in a quart)(v) Returns this same amount as the output of the function. |
|
Answer» pi=22/7 RADIAN = float(INPUT('Radius of sphere: ')) sur_area = 4 * pi * radian **2 VOLUME = (4/3) * (pi * radian ** 3) print("Surface Area is: ", sur_area) print("Volume is: ", volume)EXPLANATION: |
|