Question
PYTHON 3 Assignment: Write code that does the following: Asks the user to enter: T Hrs = Urine collection time in hours U Vo l
PYTHON 3 Assignment:
Write code that does the following:
Asks the user to enter:
THrs = Urine collection time in hours
UVol = Urine volume in milliliters (mL)
UCr = Urine creatinine level (mg/dL)
PCr = Plasma creatinine level (mg/dL)
Weight in lbs
Height in inches
Sex (male or female).
Note: The variables need not have these names. These variable names are given to illustrate the formula/calculation.
2.Returns an error message if:
If any of the following variables are entered as strings: THrs , UVol , UCr , PCr , Weight, Height
If Sex is any value other than M or F
3.Converts T Hrs from hours into minutes (TMin).
4.Calculates Body Surface Area (BSA) by:
a.Converting pounds (lbs) into kilograms (kg) = body weight (BW)
i.1 lb = 0.453592 Kg
b.Converting inches into centimeters (cm) = height (H)
i.1 inch = 2.54 cm
c.BSA = 0.007184 * height (cm)0.725 * weight (kg)0.425
5.Calculates the corrected creatinine clearance through the following process:
CrCl = UCr * UVol/(PCr*Tmin)
Corrected CrCl = CrCl* (1.73/BSA)
Lets the user know whether the corrected creatinine clearance is within a normal range:
Male: 97 to 137 mL/min
Female: 88 to 128 mL/min
Or if the value is not within the normal range.
Program this code such that it runs 4 times total after which point it stops with a note saying that the program has been run a maximum number of times.
To test your code, enter the following cases:
For all:
i.Urine collection time (THrs): 24 hours
ii.Urine volume in mL (UVol): 1000 mL
Female:
i.Weight in lbs: 170
ii.Height in inches: 63
iii.Normal: (Corrected CrCl: 116.5)
UCr = Urine creatinine level (mg/dL): 175
PCr = Plasma creatinine level (mg/dL): 1.0
iv.Abnormal: (Corrected CrCl: 47.5 mL/min)
UCr = Urine creatinine level (mg/dL): 100
PCr = Plasma creatinine level (mg/dL): 1.4
Male:
i.Weight in lbs: 200
ii.Height in inches: 70
iii.Normal: (Corrected CrCl: 100.7 mL/min)
UCr = Urine creatinine level (mg/dL): 175
PCr = Plasma creatinine level (mg/dL): 1.0
iv.Abnormal: (Corrected CrCl: 41.1 mL/min)
UCr = Urine creatinine level (mg/dL): 100
PCr = Plasma creatinine level (mg/dL): 1.4
Example output
Enter the urine collection time in hours: 24
Enter the urine volume in milliliters (mL): 1000
Enter the urine creatinine level in mg/dL: 100
Enter the plasma creatinine level in mg/dL: 1.4
Enter the patient's weight in lbs: 200
Enter the patient's weight in inches: 70
Enter the sex of the patient (M or F): M
CrCl is 41.1 mL/min
CrCl is not within normal range
Example error outputs
Enter the urine collection time in hours: twenty-four
Entry must be a number
Please re-run program and re-enter value as a number.
Enter the sex of the patient (M or F): Male
Must input M for male or F for female
Please re-run program and re-enter M or F.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started