Question: Function name (1): weight_on_mars Parameters: N/A Return value: N/A Description: Write a Python program which accepts you weight on Earth and prints out your weight
Function name (1): weight_on_mars Parameters: N/A Return value: N/A Description: Write a Python program which accepts you weight on Earth and prints out your weight on Mars. Assume that the weight inputted is not negative. The weight can be 1. Ask the user to input their weight on Earth in pounds. 2. Your weight on Mars is 0.38 of your weight on Earth. For example. If you weight 100 pounds on Earth, you would weigh 38 pounds on Mars. 3. Print out the answer in the format: "At a weight of 100 pounds on Earth, you would weigh 38 pounds on Mars". Test Cases (not an exhaustive list): 1. > > > What is your weight on Earth (in pounds)? 150 At a weight of 150 pounds on Earth, you would weigh 57 pounds on Mars. 2. > > > What is your weight on Earth (in pounds)? 100.8 At a weight of 180.8 pounds on Earth, you would weigh 38.304 pounds on Mars. Function name (2): volume_of_cone Parameters: N/A Return value: volume of the cone Description: Write a function that that takes the radius and height from the user and calculates the volume of a cone. 1. Get the length of the radius of the cone from the user. 2. Got the height of no cone from the user. 3. Calculate the volume of a cone with the radius length and height entered by the user using the following formula: Volume = pi middot radius^2 middot height/3 4. Return the volume of the cone rounded to three decimal places. Test Cases (not an exhaustive list): 1. > > > a = volume_of_cone () > > > What is the length of the radius of the cone? 3 > > > What is the height of the cone? 4 > > > print (a) 37.699 2. > > > b = volume_of_cone () > > > What is the length of the radius of the cone? HOMEWORK 01: FUNCTIONS & STATEMENTS 4 2. > > > b = volume_of_cone() > > > What is the length of the radius of the cone
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
