Question: undefined def function_name(arg1, arg2, etc.) # this line is the signature # commands go here # more commands # result = ... return result #

undefined def function_name(arg1, arg2, etc.) # this line is the signature #commands go here # more commands # result = ... return result# this line returns the result of your computations The following areundefined

def function_name(arg1, arg2, etc.) # this line is the signature # commands go here # more commands # result = ... return result # this line returns the result of your computations The following are the functions you must implement: blood pressure(systolic, diastolic) Description: Blood pressure is measured using two numbers. The first number, called systolic blood pressure, measures the pressure in your blood vessels when your heart beats. The second number, called diastolic blood pressure, measures the pressure in your blood vessels when your heart rests between beats. The American Heart Association categorizes the blood pressure according to the following chart (verbatim copy from the official site): Blood Pressure Category Normal Elevated Hypertension Stage 1 Hypertension Stage 2 Hypertensive Crisis Systolic less than 120 120 - 129 130 - 139 140 or higher higher than 180 AND AND OR OR AND/OR Diastolic less than 80 less than 80 80 - 89 90 or higher higher than 120 Assume that normal corresponds to risk level 1.0, elevated corresponds to risk level 1.1, and so forth (the max is hypertensive crisis which corresponds to risk level 1.4). In case a measurement can be classified in more than one categories, we assign it to the one with the highest risk. Calculate this risk level as well as the mean arterial pressure, defined as: systolic + 2 diastolic meanpressure = 3 Parameters: systolic (int) is the systolic blood pressure, diastolic (int) is the diastolic blood pressure Return value: The function returns the product of risk level times the mean arterial pressure as a float rounded to 2 decimals (hint: there is a Python built-in function for rounding) Examples: blood pressure(106,75) blood pressure(148, 90) 85.33 142.13 def blood pressure (systolic, diastolic): syslevels = [120, 130, 140, 180, 1000] dialevels = [80, 80, 90, 120, 1000] risklevels = [1, 1.1, 1.2, 1.3, 1.4] mean_pres = (systolic + 2 * diastolic) / 3.0 risk = 0 # Find the syslevel below which systolic is to determine risk for i in range (len (syslevels)): if systolic dialevels[i]: if risk

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!