Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Coding Problem 3.4.8 (Exterhal Te BloodPressure.py 3 1|#0onsult this blood press

ID: 3920728 • Letter: C

Question

Coding Problem 3.4.8 (Exterhal Te BloodPressure.py 3 1|#0onsult this blood pressures chart: http://bit.ly/2C10ACs 3 Write a function called check blood pressure that takes two 4 parameters: a systolic blood pressure and a diastolic blood 5#pressure, in that order. Your function should return "Low", 6 Ideal, "Pre-high" ", or "High"-whichever corresponds to 7 the given systolic and diastolic blood pressure. 9 You should assume that if a combined blood pressure is on the 10,#line between two categories (e.g. 80 and 60, or 120 and 70). 11 Wthe result should be the higher category (e.g. Ideal and 12 Pre-high for those two combinations). 14 HINT: Don't overcomplicate thisl Think carefully about in 15 what order you should check the different categories. This 16 fproblem could be easy or extremely hard depending on the 17 #0rder you change and whether you use returns or elifs wisely. 18 20 #Add your code here 24 "Below are some lines of code that will test your function. 25 #You can change the value of the variable (s) to test your 26 #function with different inputs. 28 #1f.your.function works correctly, this will originally 29 print: Ideal 30 test systolic 110 31 test diastolic70 33 print (check blood_pressure(test systolic, test diastolic))

Explanation / Answer

def check_blood_pressure(systolic, diastolic): if systolic >= 140 and diastolic >= 90: return 'High' elif systolic >= 120 and diastolic >= 80: return 'High' elif systolic >= 90 and diastolic >= 60: return 'High' else: return 'Low'