Question: help with these functions please, python 2. Write a function convert_to_inches(yards, feet) that takes two numeric inputs yards and feet that together represent a single

help with these functions please, python 2. Write a function convert_to_inches(yards, feet)help with these functions please, python

2. Write a function convert_to_inches(yards, feet) that takes two numeric inputs yards and feet that together represent a single length broken up into yards and feet, and that returns the corresponding length in inches. For example: convert_to_inches (4,2)#4 yards +2 feet 168 inches result: 168 convert_to_inches (1,1)#1 yard +1 foot =48 inches result: 48 If either input is negative, it should be replaced with a 0 in your computation. For example: convert_to_inches (4,2)# replace 4 with 0,2 feet =24 inches result: 24 convert_to_inches (3,5) \# replace 5 with 0,3 yards =108 inches result: 108 Hints: - 1 foot is 12 inchos, and 1 yard is 3 feet or 36 inches. - You should use conditional execution to handle cases in which an input is less than 0. 3. Witite a function area_sq_irches (height_yds, height_Ft, width_yds, width_ft) Uhat takes soer numerli inputs: numercinputs: - height_-rds aid height fft that togather repregent tte height of a nectangle - widthyds and width_ft thas together ropresent the with of a rectangle Based an these inputs, the function should return the area of the rectange in oquare inchas. In other words. it should - determine the height at the rectange in inches - determine the width of the rectangle in inches - return the product of thicse two values Examples: Pbs area sa inches (1,2,3,1)(1yd,2ft)(3yds,1ft)7200 s4 inches result: 2000 mos arec_sa_tinches (2,,1,2)=(2yds,ft)(1yd,2f)=4320 sa inches result: 4320 result: 4320 Notes: - Vou must start by makng two calls to the ccnvert_to_inches tuncion that you wrote eariter-one call to compute the haght in inches, and one cal to compute the with in inches and stom the nssulns of thoes cals in variables. Then you must use thase veriahtist to computs the area. - It any of the inpuls are neyat ve, they should be repiaced wht a 0 . Howower, because you are celling convert, to_inches, you car let that ether function handio the roplocoments for youl 4. Write a function medien (a,b,c) that takes three numeric inputs a,b, and c, and that returns the median of the three inputs-i.e., the value that falls in the middle of the other two when the three values are listed in increasing order. For example: median (10,2,7)#7 is the middle value of 2,7,10 result: 7 Ps> median (7,2,10)#7 is still the midale vatue of 2,7,10 result: 7 median (8,6,4) result: 6 result: 6 Your function must use conditional exacution, and it should not use any of Python's built-in functions. Your function should also work if two or more of the values are the same: 3 median (10,2,2)#2 is the middle value of 2,2,10 result: 2 Hint: Python makes it easy to test if one value is between two other values. For example, to test if x is in the intarual [0,10], we could use this expreceion: B

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!