Question: For your third program, you will write a program that uses the constants and functions that are part of the Math and Random modules for
For your third program, you will write a program that uses the constants and functions that are part of the Math and Random modules for Python. Your program will:
Calculate the volume of a Sphere.
Calculate the factorial of a randomly generated number between and
The formula for the volume of a sphere is shown below. You will need to use the pi constant and the pow function in the Math module to write a python expression of the following equation.
Volume
Your program should ask the user to enter the radius of the sphere. To generate the random number between and you will need to use the randint function in the Random module. To compute the factorial of a number, you will need to use the factorial function in the math module. The floatingpoint value must be formatted to display only two digits after the decimal point.
Example Output
Your output should be formatted like the image below.
Please enter the radius of the sphere: The volume of a sphere with radius of is
The factorial of is
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
